Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
buildstream
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
6
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
BuildStream
buildstream
Commits
eb4286fd
Commit
eb4286fd
authored
6 years ago
by
Tristan Maat
Browse files
Options
Downloads
Patches
Plain Diff
WIP: Add tests
parent
357bb9da
No related branches found
No related tags found
No related merge requests found
Pipeline
#43869748
failed
6 years ago
Stage: test
Stage: post
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/integration/messages.py
+70
-0
70 additions, 0 deletions
tests/integration/messages.py
with
70 additions
and
0 deletions
tests/integration/messages.py
0 → 100644
+
70
−
0
View file @
eb4286fd
#
# Copyright (C) 2018 Codethink Limited
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see <http://www.gnu.org/licenses/>.
#
# Authors: Tristan Maat <tristan.maat@codethink.co.uk>
#
import
os
import
pytest
from
buildstream
import
_yaml
from
test.testutils
import
cli_integration
as
cli
pytestmark
=
pytest
.
mark
.
integration
# Project directory
DATA_DIR
=
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
)),
"
project
"
,
)
@pytest.mark.integration
@pytest.mark.datafiles
(
DATA_DIR
)
def
test_disable_message_lines
(
cli
,
tmpdir
,
datafiles
):
project
=
os
.
path
.
join
(
datafiles
.
dirname
,
datafiles
.
basename
)
element_path
=
os
.
path
.
join
(
project
,
'
elements
'
)
element_name
=
'
message.bst
'
element
=
{
'
kind
'
:
'
manual
'
,
'
depends
'
:
[{
'
filename
'
:
'
base.bst
'
}],
'
config
'
:
[
{
'
build-commands
'
:
[
'
echo
"
Silly message
"'
],
'
strip-commands
'
:
[]
}
]
}
os
.
makedirs
(
os
.
path
.
dirname
(
os
.
path
.
join
(
element_path
,
element_name
)),
exist_ok
=
True
)
_yaml
.
dump
(
element
,
os
.
path
.
join
(
element_path
,
element_name
))
# First we check that we get the "Silly message"
result
=
cli
.
run
(
project
=
project
,
args
=
[
"
build
"
,
element_name
])
assert
result
.
exit_code
==
0
assert
result
.
stderr
.
contains
(
"
Silly message
"
)
# Let's now build it again, but with --message-lines 0
result
=
cli
.
run
(
project
=
project
,
args
=
[
"
--message-lines 0
"
,
"
build
"
,
element_name
])
assert
result
.
exit_code
==
0
assert
not
result
.
stderr
.
contains
(
"
Silly message
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment