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
3
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
BuildStream
buildstream
Compare revisions
7676b57d631b179579fa02d913f992ac35459698 to f1b0e393209cfb378fe293f8ce5897fc20376cbe
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
BuildStream/buildstream
Select target project
No results found
f1b0e393209cfb378fe293f8ce5897fc20376cbe
Select Git revision
Branches
108-integration-tests-not-idempotent-and-self-contained
131-behavior-of-except-argument-is-frustrating-and-confusing
132-loading-external-plugins-works-without-explicit-requirement-in-project-conf
135-expire-artifacts-in-local-cache
135-expire-artifacts-in-local-cache-clean
138-aborting-bst-push-command-causes-stack-trace-3
142-potentially-printing-provenance-more-than-once-in-loaderrors
188-trigger-external-commands-on-certain-events
214-filter-workspacing-rework
218-allow-specifying-the-chroot-binary-to-use-for-sandboxes-on-unix-platforms
239-use-pylint-for-linting
372-allow-queues-to-run-auxilliary-jobs-after-an-element-s-job-finishes
380-untagged-bst
463-make-dependency-type-default-to-build
537-mirror-fallback-does-not-work-for-git
64-clarify-about-plugins-importing-other-plugins
716-add-example-with-build-directory-outside-of-source-directory
716-add-example-with-build-directory-outside-of-source-directory-2
81-non-empty-read-only-directories-not-handled-during-bst-build-and-others
BenjaminSchubert/fix-quota-tests
Qinusty/235-manifest
Qinusty/397
Qinusty/470-bst-track-yaml-indent
Qinusty/553-backport-1.2
Qinusty/663-missing-cache-key-workspace-open
Qinusty/backport-576
Qinusty/backport-skipped-562
Qinusty/gitlab-ci
Qinusty/gitlab-ci-duration
Qinusty/message-helpers
Qinusty/pytest_cache_gitignore
abderrahim/cached-failure
abderrahim/cachekey-strictrebuild
abderrahim/cleanup-speedup
abderrahim/makemaker
abderrahim/resolve-remotes
abderrahim/source-cache
abderrahim/stage-artifact-scriptelement
abderrahim/virtual-extract
adamjones/contributing
adamjones/contribution-guide
aevri/assert_no_unexpected_size_writes
aevri/casdprocessmanager2
aevri/check_spawn_ci_working
aevri/enable_spawn_ci_4
aevri/enable_spawn_ci_6
aevri/enable_spawn_ci_7
aevri/json_artifact_meta
aevri/picklable_jobs
aevri/plugin_venvs
aevri/provenance_scope
aevri/pylint_ignore_argsdiff
aevri/safe_noninteractive
aevri/win32
aevri/win32_minimal
aevri/win32_minimal_seemstowork_20190829
aevri/win32_receive_signals
aevri/win32_temptext
alexfazakas/add-bst-init-argument
alexfazakas/use-merge-trains
always-do-linting
another-segfault
becky/locally_downloaded_files
becky/shell_launch_errors
bschubert/add-isolated-tests
bschubert/isort
bschubert/merge-parent-child-job
bschubert/more-mypy
bschubert/no-multiprocessing-bak
bschubert/no-multiprocessing-full
bschubert/optimize-deps
bschubert/optimize-element-init
bschubert/optimize-loader-sorting
bschubert/optimize-mapping-node
bschubert/optimize-splits
bschubert/remove-multiline-switch-for-re
bschubert/remove-parent-child-pipe
bschubert/remove-pip-source
bschubert/standardize-source-tests
bschubert/test-plugins
bschubert/update-coverage
bst-1
bst-1.0
bst-1.2
bst-1.4
bst-pull
bst-push
buildbox-pre-will
cache-key-v0
caching_build_trees
cascache_timeouts
chandan/automate-pypi-release
chandan/cli-deps
chandan/contrib-dependencies
chandan/element-cache
chandan/enums
chandan/extras-require
chandan/macos-multiprocessing
chandan/moar-parallelism
chandan/moar-runners
Tags
1.0.0
1.0.1
1.1.0
1.1.1
1.1.2
1.1.3
1.1.4
1.1.5
1.1.6
1.1.7
1.2.0
1.2.1
1.2.2
1.2.3
1.2.4
1.2.5
1.2.6
1.2.7
1.2.8
1.3.0
1.3.1
1.4.0
1.4.1
1.4.2
1.4.3
1.5.0
1.5.1
1.6.0
1.6.1
1.91.0
1.91.1
1.91.2
1.91.3
1.93.0
1.93.1
1.93.2
1.93.3
1.93.4
1.93.5
CROSS_PLATFORM_SEPT_2017
PRE_CAS_MERGE_JULY_2018
bst-1-branchpoint
bst-1.2-branchpoint
bst-1.4-branchpoint
144 results
Swap
Target
BuildStream/buildstream
Select target project
willsalmon/buildstream
CumHoleZH/buildstream
tchaik/buildstream
DCotyPortfolio/buildstream
jesusoctavioas/buildstream
patrickmmartin/buildstream
franred/buildstream
tintou/buildstream
alatiera/buildstream
martinblanchard/buildstream
neverdie22042524/buildstream
Mattlk13/buildstream
PServers/buildstream
phamnghia610909/buildstream
chiaratolentino/buildstream
eysz7-x-x/buildstream
kerrick1/buildstream
matthew-yates/buildstream
twofeathers/buildstream
mhadjimichael/buildstream
pointswaves/buildstream
Mr.JackWilson/buildstream
Tw3akG33k/buildstream
AlexFazakas/buildstream
eruidfkiy/buildstream
clamotion2/buildstream
nanonyme/buildstream
wickyjaaa/buildstream
nmanchev/buildstream
bojorquez.ja/buildstream
mostynb/buildstream
highpit74/buildstream
Demo112/buildstream
ba2014sheer/buildstream
tonimadrino/buildstream
usuario2o/buildstream
Angelika123456/buildstream
neo355/buildstream
corentin-ferlay/buildstream
coldtom/buildstream
wifitvbox81/buildstream
358253885/buildstream
seanborg/buildstream
SotK/buildstream
DouglasWinship/buildstream
karansthr97/buildstream
louib/buildstream
bwh-ct/buildstream
robjh/buildstream
we88c0de/buildstream
zhengxian5555/buildstream
51 results
7676b57d631b179579fa02d913f992ac35459698
Select Git revision
Branches
108-integration-tests-not-idempotent-and-self-contained
131-behavior-of-except-argument-is-frustrating-and-confusing
132-loading-external-plugins-works-without-explicit-requirement-in-project-conf
135-expire-artifacts-in-local-cache
135-expire-artifacts-in-local-cache-clean
138-aborting-bst-push-command-causes-stack-trace-3
142-potentially-printing-provenance-more-than-once-in-loaderrors
188-trigger-external-commands-on-certain-events
214-filter-workspacing-rework
218-allow-specifying-the-chroot-binary-to-use-for-sandboxes-on-unix-platforms
239-use-pylint-for-linting
372-allow-queues-to-run-auxilliary-jobs-after-an-element-s-job-finishes
380-untagged-bst
463-make-dependency-type-default-to-build
537-mirror-fallback-does-not-work-for-git
64-clarify-about-plugins-importing-other-plugins
716-add-example-with-build-directory-outside-of-source-directory
716-add-example-with-build-directory-outside-of-source-directory-2
81-non-empty-read-only-directories-not-handled-during-bst-build-and-others
BenjaminSchubert/fix-quota-tests
Qinusty/235-manifest
Qinusty/397
Qinusty/470-bst-track-yaml-indent
Qinusty/553-backport-1.2
Qinusty/663-missing-cache-key-workspace-open
Qinusty/backport-576
Qinusty/backport-skipped-562
Qinusty/gitlab-ci
Qinusty/gitlab-ci-duration
Qinusty/message-helpers
Qinusty/pytest_cache_gitignore
abderrahim/cached-failure
abderrahim/cachekey-strictrebuild
abderrahim/cleanup-speedup
abderrahim/makemaker
abderrahim/resolve-remotes
abderrahim/source-cache
abderrahim/stage-artifact-scriptelement
abderrahim/virtual-extract
adamjones/contributing
adamjones/contribution-guide
aevri/assert_no_unexpected_size_writes
aevri/casdprocessmanager2
aevri/check_spawn_ci_working
aevri/enable_spawn_ci_4
aevri/enable_spawn_ci_6
aevri/enable_spawn_ci_7
aevri/json_artifact_meta
aevri/picklable_jobs
aevri/plugin_venvs
aevri/provenance_scope
aevri/pylint_ignore_argsdiff
aevri/safe_noninteractive
aevri/win32
aevri/win32_minimal
aevri/win32_minimal_seemstowork_20190829
aevri/win32_receive_signals
aevri/win32_temptext
alexfazakas/add-bst-init-argument
alexfazakas/use-merge-trains
always-do-linting
another-segfault
becky/locally_downloaded_files
becky/shell_launch_errors
bschubert/add-isolated-tests
bschubert/isort
bschubert/merge-parent-child-job
bschubert/more-mypy
bschubert/no-multiprocessing-bak
bschubert/no-multiprocessing-full
bschubert/optimize-deps
bschubert/optimize-element-init
bschubert/optimize-loader-sorting
bschubert/optimize-mapping-node
bschubert/optimize-splits
bschubert/remove-multiline-switch-for-re
bschubert/remove-parent-child-pipe
bschubert/remove-pip-source
bschubert/standardize-source-tests
bschubert/test-plugins
bschubert/update-coverage
bst-1
bst-1.0
bst-1.2
bst-1.4
bst-pull
bst-push
buildbox-pre-will
cache-key-v0
caching_build_trees
cascache_timeouts
chandan/automate-pypi-release
chandan/cli-deps
chandan/contrib-dependencies
chandan/element-cache
chandan/enums
chandan/extras-require
chandan/macos-multiprocessing
chandan/moar-parallelism
chandan/moar-runners
Tags
1.0.0
1.0.1
1.1.0
1.1.1
1.1.2
1.1.3
1.1.4
1.1.5
1.1.6
1.1.7
1.2.0
1.2.1
1.2.2
1.2.3
1.2.4
1.2.5
1.2.6
1.2.7
1.2.8
1.3.0
1.3.1
1.4.0
1.4.1
1.4.2
1.4.3
1.5.0
1.5.1
1.6.0
1.6.1
1.91.0
1.91.1
1.91.2
1.91.3
1.93.0
1.93.1
1.93.2
1.93.3
1.93.4
1.93.5
CROSS_PLATFORM_SEPT_2017
PRE_CAS_MERGE_JULY_2018
bst-1-branchpoint
bst-1.2-branchpoint
bst-1.4-branchpoint
144 results
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
buildstream/plugins/sources/remote.py: Make staging deterministic.
· b99db456
Valentin David
authored
6 years ago
b99db456
Add some integration tests for source plugin determinism.
· f1b0e393
Valentin David
authored
6 years ago
f1b0e393
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
buildstream/plugins/sources/remote.py
+1
-1
1 addition, 1 deletion
buildstream/plugins/sources/remote.py
tests/integration/source-determinism.py
+155
-0
155 additions, 0 deletions
tests/integration/source-determinism.py
with
156 additions
and
1 deletion
buildstream/plugins/sources/remote.py
View file @
f1b0e393
...
...
@@ -74,7 +74,7 @@ class RemoteSource(DownloadableFileSource):
# are not write protected in the sandbox.
dest
=
os
.
path
.
join
(
directory
,
self
.
filename
)
with
self
.
timed_activity
(
"
Staging remote file to {}
"
.
format
(
dest
)):
utils
.
safe_copy
(
self
.
_get_mirror_file
(),
dest
)
utils
.
safe_copy
(
self
.
_get_mirror_file
(),
dest
,
deterministic
=
True
)
def
setup
():
...
...
This diff is collapsed.
Click to expand it.
tests/integration/source-determinism.py
0 → 100644
View file @
f1b0e393
import
os
import
pytest
from
buildstream
import
_yaml
,
utils
from
tests.testutils
import
cli
,
create_repo
,
ALL_REPO_KINDS
DATA_DIR
=
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
)),
"
project
"
)
def
create_test_file
(
*
path
,
mode
=
0o644
,
content
=
'
content
\n
'
):
path
=
os
.
path
.
join
(
*
path
)
os
.
makedirs
(
os
.
path
.
dirname
(
path
),
exist_ok
=
True
)
with
open
(
path
,
'
w
'
)
as
f
:
f
.
write
(
content
)
os
.
fchmod
(
f
.
fileno
(),
mode
)
def
create_test_directory
(
*
path
,
mode
=
0o644
):
create_test_file
(
*
path
,
'
.keep
'
,
content
=
''
)
path
=
os
.
path
.
join
(
*
path
)
os
.
chmod
(
path
,
mode
)
@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
):
project
=
str
(
datafiles
)
element_name
=
'
list
'
element_path
=
os
.
path
.
join
(
project
,
'
elements
'
,
element_name
)
repodir
=
os
.
path
.
join
(
str
(
tmpdir
),
'
repo
'
)
sourcedir
=
os
.
path
.
join
(
project
,
'
source
'
)
create_test_file
(
sourcedir
,
'
a.txt
'
,
mode
=
0o700
)
create_test_file
(
sourcedir
,
'
b.txt
'
,
mode
=
0o755
)
create_test_file
(
sourcedir
,
'
c.txt
'
,
mode
=
0o600
)
create_test_file
(
sourcedir
,
'
d.txt
'
,
mode
=
0o400
)
create_test_file
(
sourcedir
,
'
e.txt
'
,
mode
=
0o644
)
create_test_file
(
sourcedir
,
'
f.txt
'
,
mode
=
0o4755
)
create_test_file
(
sourcedir
,
'
g.txt
'
,
mode
=
0o2755
)
create_test_file
(
sourcedir
,
'
h.txt
'
,
mode
=
0o1755
)
create_test_directory
(
sourcedir
,
'
dir-a
'
,
mode
=
0o0700
)
create_test_directory
(
sourcedir
,
'
dir-c
'
,
mode
=
0o0755
)
create_test_directory
(
sourcedir
,
'
dir-d
'
,
mode
=
0o4755
)
create_test_directory
(
sourcedir
,
'
dir-e
'
,
mode
=
0o2755
)
create_test_directory
(
sourcedir
,
'
dir-f
'
,
mode
=
0o1755
)
if
kind
==
'
local
'
:
source
=
{
'
kind
'
:
'
local
'
,
'
path
'
:
'
source
'
}
else
:
repo
=
create_repo
(
kind
,
repodir
)
ref
=
repo
.
create
(
sourcedir
)
source
=
repo
.
source_config
(
ref
=
ref
)
element
=
{
'
kind
'
:
'
manual
'
,
'
depends
'
:
[
{
'
filename
'
:
'
base.bst
'
,
'
type
'
:
'
build
'
}
],
'
sources
'
:
[
source
],
'
config
'
:
{
'
install-commands
'
:
[
'
ls -l >
"
%{install-root}/ls-l
"'
]
}
}
_yaml
.
dump
(
element
,
element_path
)
def
get_value_for_umask
(
umask
):
checkoutdir
=
os
.
path
.
join
(
str
(
tmpdir
),
'
checkout-{}
'
.
format
(
umask
))
old_umask
=
os
.
umask
(
umask
)
try
:
result
=
cli
.
run
(
project
=
project
,
args
=
[
'
build
'
,
element_name
])
result
.
assert_success
()
result
=
cli
.
run
(
project
=
project
,
args
=
[
'
checkout
'
,
element_name
,
checkoutdir
])
result
.
assert_success
()
with
open
(
os
.
path
.
join
(
checkoutdir
,
'
ls-l
'
),
'
r
'
)
as
f
:
return
f
.
read
()
finally
:
os
.
umask
(
old_umask
)
cli
.
remove_artifact_from_cache
(
project
,
element_name
)
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
):
"""
Only user rights should be considered for local source.
"""
project
=
str
(
datafiles
)
element_name
=
'
test
'
element_path
=
os
.
path
.
join
(
project
,
'
elements
'
,
element_name
)
sourcedir
=
os
.
path
.
join
(
project
,
'
source
'
)
element
=
{
'
kind
'
:
'
manual
'
,
'
depends
'
:
[
{
'
filename
'
:
'
base.bst
'
,
'
type
'
:
'
build
'
}
],
'
sources
'
:
[
{
'
kind
'
:
'
local
'
,
'
path
'
:
'
source
'
}
],
'
config
'
:
{
'
install-commands
'
:
[
'
ls -l >
"
%{install-root}/ls-l
"'
]
}
}
_yaml
.
dump
(
element
,
element_path
)
def
get_value_for_mask
(
mask
):
checkoutdir
=
os
.
path
.
join
(
str
(
tmpdir
),
'
checkout-{}
'
.
format
(
mask
))
create_test_file
(
sourcedir
,
'
a.txt
'
,
mode
=
0o644
&
mask
)
create_test_file
(
sourcedir
,
'
b.txt
'
,
mode
=
0o755
&
mask
)
create_test_file
(
sourcedir
,
'
c.txt
'
,
mode
=
0o4755
&
mask
)
create_test_file
(
sourcedir
,
'
d.txt
'
,
mode
=
0o2755
&
mask
)
create_test_file
(
sourcedir
,
'
e.txt
'
,
mode
=
0o1755
&
mask
)
create_test_directory
(
sourcedir
,
'
dir-a
'
,
mode
=
0o0755
&
mask
)
create_test_directory
(
sourcedir
,
'
dir-b
'
,
mode
=
0o4755
&
mask
)
create_test_directory
(
sourcedir
,
'
dir-c
'
,
mode
=
0o2755
&
mask
)
create_test_directory
(
sourcedir
,
'
dir-d
'
,
mode
=
0o1755
&
mask
)
try
:
result
=
cli
.
run
(
project
=
project
,
args
=
[
'
build
'
,
element_name
])
result
.
assert_success
()
result
=
cli
.
run
(
project
=
project
,
args
=
[
'
checkout
'
,
element_name
,
checkoutdir
])
result
.
assert_success
()
with
open
(
os
.
path
.
join
(
checkoutdir
,
'
ls-l
'
),
'
r
'
)
as
f
:
return
f
.
read
()
finally
:
cli
.
remove_artifact_from_cache
(
project
,
element_name
)
assert
get_value_for_mask
(
0o7777
)
==
get_value_for_mask
(
0o0700
)
This diff is collapsed.
Click to expand it.