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
d824489b
Commit
d824489b
authored
6 years ago
by
Valentin David
Committed by
Tristan Van Berkom
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
tests/integration/source-determinism.py: Use cli_integration.
parent
301a393c
Branches
Branches containing commit
Tags
Tags containing commit
Loading
Pipeline
#28586163
passed
6 years ago
Stage: prepare
Stage: test
Stage: post
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/integration/source-determinism.py
+10
-5
10 additions, 5 deletions
tests/integration/source-determinism.py
tests/testutils/runcli.py
+4
-2
4 additions, 2 deletions
tests/testutils/runcli.py
with
14 additions
and
7 deletions
tests/integration/source-determinism.py
+
10
−
5
View file @
d824489b
...
...
@@ -2,7 +2,8 @@ import os
import
pytest
from
buildstream
import
_yaml
,
utils
from
tests.testutils
import
cli
,
create_repo
,
ALL_REPO_KINDS
from
tests.testutils
import
create_repo
,
ALL_REPO_KINDS
from
tests.testutils
import
cli_integration
as
cli
DATA_DIR
=
os
.
path
.
join
(
...
...
@@ -28,7 +29,7 @@ def create_test_directory(*path, mode=0o644):
@pytest.mark.integration
@pytest.mark.datafiles
(
DATA_DIR
)
@pytest.mark.parametrize
(
"
kind
"
,
[(
kind
)
for
kind
in
ALL_REPO_KINDS
]
+
[
'
local
'
])
def
test_deterministic_source_umask
(
cli
,
tmpdir
,
datafiles
,
kind
):
def
test_deterministic_source_umask
(
cli
,
tmpdir
,
datafiles
,
kind
,
integration_cache
):
project
=
str
(
datafiles
)
element_name
=
'
list
'
element_path
=
os
.
path
.
join
(
project
,
'
elements
'
,
element_name
)
...
...
@@ -91,14 +92,16 @@ def test_deterministic_source_umask(cli, tmpdir, datafiles, kind):
return
f
.
read
()
finally
:
os
.
umask
(
old_umask
)
cli
.
remove_artifact_from_cache
(
project
,
element_name
)
cache_dir
=
os
.
path
.
join
(
integration_cache
,
'
artifacts
'
)
cli
.
remove_artifact_from_cache
(
project
,
element_name
,
cache_dir
=
cache_dir
)
assert
get_value_for_umask
(
0o022
)
==
get_value_for_umask
(
0o077
)
@pytest.mark.integration
@pytest.mark.datafiles
(
DATA_DIR
)
def
test_deterministic_source_local
(
cli
,
tmpdir
,
datafiles
):
def
test_deterministic_source_local
(
cli
,
tmpdir
,
datafiles
,
integration_cache
):
"""
Only user rights should be considered for local source.
"""
project
=
str
(
datafiles
)
...
...
@@ -150,6 +153,8 @@ def test_deterministic_source_local(cli, tmpdir, datafiles):
with
open
(
os
.
path
.
join
(
checkoutdir
,
'
ls-l
'
),
'
r
'
)
as
f
:
return
f
.
read
()
finally
:
cli
.
remove_artifact_from_cache
(
project
,
element_name
)
cache_dir
=
os
.
path
.
join
(
integration_cache
,
'
artifacts
'
)
cli
.
remove_artifact_from_cache
(
project
,
element_name
,
cache_dir
=
cache_dir
)
assert
get_value_for_mask
(
0o7777
)
==
get_value_for_mask
(
0o0700
)
This diff is collapsed.
Click to expand it.
tests/testutils/runcli.py
+
4
−
2
View file @
d824489b
...
...
@@ -198,7 +198,9 @@ class Cli():
for
key
,
val
in
config
.
items
():
self
.
config
[
key
]
=
val
def
remove_artifact_from_cache
(
self
,
project
,
element_name
):
def
remove_artifact_from_cache
(
self
,
project
,
element_name
,
*
,
cache_dir
=
None
):
if
not
cache_dir
:
cache_dir
=
os
.
path
.
join
(
project
,
'
cache
'
,
'
artifacts
'
)
cache_dir
=
os
.
path
.
join
(
cache_dir
,
'
cas
'
,
'
refs
'
,
'
heads
'
)
...
...
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