Benjamin Schubert pushed to branch bschubert/tests-no-chroot-linux at BuildStream / buildstream
Commits:
-
23140b6b
by Chandan Singh at 2018-10-25T15:25:22Z
-
db2a676e
by Chandan Singh at 2018-10-25T15:26:39Z
-
356d84cd
by Chandan Singh at 2018-10-25T16:59:13Z
-
045a7024
by Benjamin Schubert at 2018-10-25T17:31:36Z
24 changed files:
- .gitlab-ci.yml
- buildstream/buildelement.py
- buildstream/plugins/elements/autotools.py
- buildstream/plugins/elements/cmake.py
- buildstream/plugins/elements/distutils.py
- buildstream/plugins/elements/import.py
- buildstream/plugins/elements/make.py
- buildstream/plugins/elements/makemaker.py
- buildstream/plugins/elements/manual.py
- buildstream/plugins/elements/meson.py
- buildstream/plugins/elements/modulebuild.py
- buildstream/plugins/elements/pip.py
- buildstream/plugins/elements/qmake.py
- buildstream/plugins/sources/bzr.py
- buildstream/plugins/sources/deb.py
- buildstream/plugins/sources/git.py
- buildstream/plugins/sources/local.py
- buildstream/plugins/sources/ostree.py
- buildstream/plugins/sources/patch.py
- buildstream/plugins/sources/pip.py
- buildstream/plugins/sources/remote.py
- buildstream/plugins/sources/tar.py
- buildstream/plugins/sources/zip.py
- buildstream/source.py
Changes:
... | ... | @@ -56,6 +56,8 @@ source_dist: |
56 | 56 |
stage: test
|
57 | 57 |
variables:
|
58 | 58 |
PYTEST_ADDOPTS: "--color=yes"
|
59 |
+ COVERAGE_ARTIFACT_PATH: "coverage-linux/"
|
|
60 |
+ |
|
59 | 61 |
script:
|
60 | 62 |
# Diagnostics
|
61 | 63 |
- mount
|
... | ... | @@ -75,15 +77,35 @@ source_dist: |
75 | 77 |
# user to test for permission issues
|
76 | 78 |
- su buildstream -c 'python3 setup.py test --index-url invalid://uri --addopts --integration'
|
77 | 79 |
|
80 |
+ after_script:
|
|
78 | 81 |
# Go back to the toplevel and collect our reports
|
79 | 82 |
- cd ../..
|
80 |
- - mkdir -p coverage-linux/
|
|
81 |
- - cp dist/buildstream/.coverage coverage-linux/coverage."${CI_JOB_NAME}"
|
|
83 |
+ - mkdir -p ${COVERAGE_ARTIFACT_PATH}
|
|
84 |
+ - cp dist/buildstream/.coverage ${COVERAGE_ARTIFACT_PATH}/coverage."${CI_JOB_NAME}"
|
|
82 | 85 |
except:
|
83 | 86 |
- schedules
|
84 | 87 |
artifacts:
|
85 | 88 |
paths:
|
86 |
- - coverage-linux/
|
|
89 |
+ - ${COVERAGE_ARTIFACT_PATH}
|
|
90 |
+ |
|
91 |
+.linux-tests-template-root: &linux-tests-as-root
|
|
92 |
+ <<: *linux-tests
|
|
93 |
+ |
|
94 |
+ script:
|
|
95 |
+ # Diagnostics
|
|
96 |
+ - mount
|
|
97 |
+ - df -h
|
|
98 |
+ |
|
99 |
+ - export INTEGRATION_CACHE="$(pwd)/cache/integration-cache"
|
|
100 |
+ |
|
101 |
+ # Unpack and get into dist/buildstream
|
|
102 |
+ - cd dist && ./unpack.sh
|
|
103 |
+ - cd buildstream
|
|
104 |
+ |
|
105 |
+ # Run the tests from the source distribution, We run as a simple
|
|
106 |
+ # user to test for permission issues
|
|
107 |
+ - python3 setup.py test --index-url invalid://uri --addopts "--integration"
|
|
108 |
+ |
|
87 | 109 |
|
88 | 110 |
tests-debian-9:
|
89 | 111 |
image: buildstream/testsuite-debian:9-master-119-552f5fc6
|
... | ... | @@ -105,37 +127,20 @@ tests-unix: |
105 | 127 |
# Use fedora here, to a) run a test on fedora and b) ensure that we
|
106 | 128 |
# can get rid of ostree - this is not possible with debian-8
|
107 | 129 |
image: buildstream/testsuite-fedora:27-master-119-552f5fc6
|
108 |
- stage: test
|
|
130 |
+ <<: *linux-tests-as-root
|
|
131 |
+ |
|
109 | 132 |
variables:
|
110 | 133 |
BST_FORCE_BACKEND: "unix"
|
134 |
+ COVERAGE_ARTIFACT_PATH: "coverage-unix/"
|
|
111 | 135 |
PYTEST_ADDOPTS: "--color=yes"
|
112 |
- script:
|
|
113 |
- |
|
114 |
- - export INTEGRATION_CACHE="$(pwd)/cache/integration-cache"
|
|
115 | 136 |
|
116 |
- # We remove the Bubblewrap and OSTree packages here so that we catch any
|
|
117 |
- # codepaths that try to use them. Removing OSTree causes fuse-libs to
|
|
118 |
- # disappear unless we mark it as user-installed.
|
|
137 |
+ # We remove the Bubblewrap and OSTree packages here so that we catch any
|
|
138 |
+ # codepaths that try to use them. Removing OSTree causes fuse-libs to
|
|
139 |
+ # disappear unless we mark it as user-installed.
|
|
140 |
+ before_script:
|
|
119 | 141 |
- dnf mark install fuse-libs
|
120 | 142 |
- dnf erase -y bubblewrap ostree
|
121 | 143 |
|
122 |
- # Unpack and get into dist/buildstream
|
|
123 |
- - cd dist && ./unpack.sh && cd buildstream
|
|
124 |
- |
|
125 |
- # Since the unix platform is required to run as root, no user change required
|
|
126 |
- - python3 setup.py test --index-url invalid://uri --addopts --integration
|
|
127 |
- |
|
128 |
- # Go back to the toplevel and collect our reports
|
|
129 |
- - cd ../..
|
|
130 |
- - mkdir -p coverage-unix/
|
|
131 |
- - cp dist/buildstream/.coverage coverage-unix/coverage.unix
|
|
132 |
- except:
|
|
133 |
- - schedules
|
|
134 |
- artifacts:
|
|
135 |
- paths:
|
|
136 |
- - coverage-unix/
|
|
137 |
- - logs-unix/
|
|
138 |
- |
|
139 | 144 |
|
140 | 145 |
# Automatically build documentation for every commit, we want to know
|
141 | 146 |
# if building documentation fails even if we're not deploying it.
|
... | ... | @@ -23,6 +23,8 @@ BuildElement - Abstract class for build elements |
23 | 23 |
The BuildElement class is a convenience element one can derive from for
|
24 | 24 |
implementing the most common case of element.
|
25 | 25 |
|
26 |
+.. _core_buildelement_builtins:
|
|
27 |
+ |
|
26 | 28 |
Built-in functionality
|
27 | 29 |
----------------------
|
28 | 30 |
|
... | ... | @@ -50,6 +50,9 @@ Here is the default configuration for the ``autotools`` element in full: |
50 | 50 |
|
51 | 51 |
.. literalinclude:: ../../../buildstream/plugins/elements/autotools.yaml
|
52 | 52 |
:language: yaml
|
53 |
+ |
|
54 |
+See :ref:`built-in functionality documentation <core_buildelement_builtins>` for
|
|
55 |
+details on common configuration options for build elements.
|
|
53 | 56 |
"""
|
54 | 57 |
|
55 | 58 |
from buildstream import BuildElement
|
... | ... | @@ -49,6 +49,9 @@ Here is the default configuration for the ``cmake`` element in full: |
49 | 49 |
|
50 | 50 |
.. literalinclude:: ../../../buildstream/plugins/elements/cmake.yaml
|
51 | 51 |
:language: yaml
|
52 |
+ |
|
53 |
+See :ref:`built-in functionality documentation <core_buildelement_builtins>` for
|
|
54 |
+details on common configuration options for build elements.
|
|
52 | 55 |
"""
|
53 | 56 |
|
54 | 57 |
from buildstream import BuildElement
|
... | ... | @@ -26,6 +26,9 @@ python distutils |
26 | 26 |
The distutils default configuration:
|
27 | 27 |
.. literalinclude:: ../../../buildstream/plugins/elements/distutils.yaml
|
28 | 28 |
:language: yaml
|
29 |
+ |
|
30 |
+See :ref:`built-in functionality documentation <core_buildelement_builtins>` for
|
|
31 |
+details on common configuration options for build elements.
|
|
29 | 32 |
"""
|
30 | 33 |
|
31 | 34 |
from buildstream import BuildElement
|
... | ... | @@ -28,6 +28,9 @@ some configuration data. |
28 | 28 |
The empty configuration is as such:
|
29 | 29 |
.. literalinclude:: ../../../buildstream/plugins/elements/import.yaml
|
30 | 30 |
:language: yaml
|
31 |
+ |
|
32 |
+See :ref:`built-in functionality documentation <core_buildelement_builtins>` for
|
|
33 |
+details on common configuration options for build elements.
|
|
31 | 34 |
"""
|
32 | 35 |
|
33 | 36 |
import os
|
... | ... | @@ -31,6 +31,9 @@ Here is the default configuration for the ``make`` element in full: |
31 | 31 |
|
32 | 32 |
.. literalinclude:: ../../../buildstream/plugins/elements/make.yaml
|
33 | 33 |
:language: yaml
|
34 |
+ |
|
35 |
+See :ref:`built-in functionality documentation <core_buildelement_builtins>` for
|
|
36 |
+details on common configuration options for build elements.
|
|
34 | 37 |
"""
|
35 | 38 |
|
36 | 39 |
from buildstream import BuildElement
|
... | ... | @@ -26,6 +26,9 @@ the Perl ExtUtil::MakeMaker build system |
26 | 26 |
The MakeMaker default configuration:
|
27 | 27 |
.. literalinclude:: ../../../buildstream/plugins/elements/makemaker.yaml
|
28 | 28 |
:language: yaml
|
29 |
+ |
|
30 |
+See :ref:`built-in functionality documentation <core_buildelement_builtins>` for
|
|
31 |
+details on common configuration options for build elements.
|
|
29 | 32 |
"""
|
30 | 33 |
|
31 | 34 |
from buildstream import BuildElement
|
... | ... | @@ -26,6 +26,9 @@ add custom build commands to the array understood by the :mod:`BuildElement <bui |
26 | 26 |
The empty configuration is as such:
|
27 | 27 |
.. literalinclude:: ../../../buildstream/plugins/elements/manual.yaml
|
28 | 28 |
:language: yaml
|
29 |
+ |
|
30 |
+See :ref:`built-in functionality documentation <core_buildelement_builtins>` for
|
|
31 |
+details on common configuration options for build elements.
|
|
29 | 32 |
"""
|
30 | 33 |
|
31 | 34 |
from buildstream import BuildElement
|
... | ... | @@ -46,6 +46,9 @@ Here is the default configuration for the ``meson`` element in full: |
46 | 46 |
|
47 | 47 |
.. literalinclude:: ../../../buildstream/plugins/elements/meson.yaml
|
48 | 48 |
:language: yaml
|
49 |
+ |
|
50 |
+See :ref:`built-in functionality documentation <core_buildelement_builtins>` for
|
|
51 |
+details on common configuration options for build elements.
|
|
49 | 52 |
"""
|
50 | 53 |
|
51 | 54 |
from buildstream import BuildElement
|
... | ... | @@ -26,6 +26,9 @@ the Perl Module::Build build system |
26 | 26 |
The modulebuild default configuration:
|
27 | 27 |
.. literalinclude:: ../../../buildstream/plugins/elements/modulebuild.yaml
|
28 | 28 |
:language: yaml
|
29 |
+ |
|
30 |
+See :ref:`built-in functionality documentation <core_buildelement_builtins>` for
|
|
31 |
+details on common configuration options for build elements.
|
|
29 | 32 |
"""
|
30 | 33 |
|
31 | 34 |
from buildstream import BuildElement
|
... | ... | @@ -26,6 +26,9 @@ Python modules with pip |
26 | 26 |
The pip default configuration:
|
27 | 27 |
.. literalinclude:: ../../../buildstream/plugins/elements/pip.yaml
|
28 | 28 |
:language: yaml
|
29 |
+ |
|
30 |
+See :ref:`built-in functionality documentation <core_buildelement_builtins>` for
|
|
31 |
+details on common configuration options for build elements.
|
|
29 | 32 |
"""
|
30 | 33 |
|
31 | 34 |
from buildstream import BuildElement
|
... | ... | @@ -26,6 +26,9 @@ the qmake build system |
26 | 26 |
The qmake default configuration:
|
27 | 27 |
.. literalinclude:: ../../../buildstream/plugins/elements/qmake.yaml
|
28 | 28 |
:language: yaml
|
29 |
+ |
|
30 |
+See :ref:`built-in functionality documentation <core_buildelement_builtins>` for
|
|
31 |
+details on common configuration options for build elements.
|
|
29 | 32 |
"""
|
30 | 33 |
|
31 | 34 |
from buildstream import BuildElement
|
... | ... | @@ -31,9 +31,6 @@ bzr - stage files from a bazaar repository |
31 | 31 |
# Specify the bzr source kind
|
32 | 32 |
kind: bzr
|
33 | 33 |
|
34 |
- # Optionally specify a relative staging directory
|
|
35 |
- # directory: path/to/stage
|
|
36 |
- |
|
37 | 34 |
# Specify the bzr url. Bazaar URLs come in many forms, see
|
38 | 35 |
# `bzr help urlspec` for more information. Using an alias defined
|
39 | 36 |
# in your project configuration is encouraged.
|
... | ... | @@ -53,6 +50,8 @@ bzr - stage files from a bazaar repository |
53 | 50 |
# revision number to the one on the tip of the branch specified in 'track'.
|
54 | 51 |
ref: 6622
|
55 | 52 |
|
53 |
+See :ref:`built-in functionality doumentation <core_source_builtins>` for
|
|
54 |
+details on common configuration options for sources.
|
|
56 | 55 |
"""
|
57 | 56 |
|
58 | 57 |
import os
|
... | ... | @@ -33,9 +33,6 @@ deb - stage files from .deb packages |
33 | 33 |
# Specify the deb source kind
|
34 | 34 |
kind: deb
|
35 | 35 |
|
36 |
- # Optionally specify a relative staging directory
|
|
37 |
- # directory: path/to/stage
|
|
38 |
- |
|
39 | 36 |
# Specify the deb url. Using an alias defined in your project
|
40 | 37 |
# configuration is encouraged. 'bst track' will update the
|
41 | 38 |
# sha256sum in 'ref' to the downloaded file's sha256sum.
|
... | ... | @@ -47,6 +44,8 @@ deb - stage files from .deb packages |
47 | 44 |
# Specify the basedir to return only the specified dir and its children
|
48 | 45 |
base-dir: ''
|
49 | 46 |
|
47 |
+See :ref:`built-in functionality doumentation <core_source_builtins>` for
|
|
48 |
+details on common configuration options for sources.
|
|
50 | 49 |
"""
|
51 | 50 |
|
52 | 51 |
import tarfile
|
... | ... | @@ -32,9 +32,6 @@ git - stage files from a git repository |
32 | 32 |
# Specify the git source kind
|
33 | 33 |
kind: git
|
34 | 34 |
|
35 |
- # Optionally specify a relative staging directory
|
|
36 |
- # directory: path/to/stage
|
|
37 |
- |
|
38 | 35 |
# Specify the repository url, using an alias defined
|
39 | 36 |
# in your project configuration is recommended.
|
40 | 37 |
url: upstream:foo.git
|
... | ... | @@ -74,6 +71,9 @@ git - stage files from a git repository |
74 | 71 |
url: upstream:baz.git
|
75 | 72 |
checkout: False
|
76 | 73 |
|
74 |
+See :ref:`built-in functionality doumentation <core_source_builtins>` for
|
|
75 |
+details on common configuration options for sources.
|
|
76 |
+ |
|
77 | 77 |
**Configurable Warnings:**
|
78 | 78 |
|
79 | 79 |
This plugin provides the following configurable warnings:
|
... | ... | @@ -29,11 +29,11 @@ local - stage local files and directories |
29 | 29 |
# Specify the local source kind
|
30 | 30 |
kind: local
|
31 | 31 |
|
32 |
- # Optionally specify a relative staging directory
|
|
33 |
- # directory: path/to/stage
|
|
34 |
- |
|
35 | 32 |
# Specify the project relative path to a file or directory
|
36 | 33 |
path: files/somefile.txt
|
34 |
+ |
|
35 |
+See :ref:`built-in functionality doumentation <core_source_builtins>` for
|
|
36 |
+details on common configuration options for sources.
|
|
37 | 37 |
"""
|
38 | 38 |
|
39 | 39 |
import os
|
... | ... | @@ -29,9 +29,6 @@ ostree - stage files from an OSTree repository |
29 | 29 |
# Specify the ostree source kind
|
30 | 30 |
kind: ostree
|
31 | 31 |
|
32 |
- # Optionally specify a relative staging directory
|
|
33 |
- # directory: path/to/stage
|
|
34 |
- |
|
35 | 32 |
# Specify the repository url, using an alias defined
|
36 | 33 |
# in your project configuration is recommended.
|
37 | 34 |
url: upstream:runtime
|
... | ... | @@ -48,6 +45,9 @@ ostree - stage files from an OSTree repository |
48 | 45 |
# For signed ostree repositories, specify a local project relative
|
49 | 46 |
# path to the public verifying GPG key for this remote.
|
50 | 47 |
gpg-key: keys/runtime.gpg
|
48 |
+ |
|
49 |
+See :ref:`built-in functionality doumentation <core_source_builtins>` for
|
|
50 |
+details on common configuration options for sources.
|
|
51 | 51 |
"""
|
52 | 52 |
|
53 | 53 |
import os
|
... | ... | @@ -37,12 +37,11 @@ patch - apply locally stored patches |
37 | 37 |
# Specify the project relative path to a patch file
|
38 | 38 |
path: files/somefile.diff
|
39 | 39 |
|
40 |
- # Optionally specify the root directory for the patch
|
|
41 |
- # directory: path/to/stage
|
|
42 |
- |
|
43 | 40 |
# Optionally specify the strip level, defaults to 1
|
44 | 41 |
strip-level: 1
|
45 | 42 |
|
43 |
+See :ref:`built-in functionality doumentation <core_source_builtins>` for
|
|
44 |
+details on common configuration options for sources.
|
|
46 | 45 |
"""
|
47 | 46 |
|
48 | 47 |
import os
|
... | ... | @@ -54,19 +54,18 @@ Downloaded tarballs will be stored in a directory called ".bst_pip_downloads". |
54 | 54 |
packages:
|
55 | 55 |
- flake8
|
56 | 56 |
|
57 |
- # Optionally specify a relative staging directory
|
|
58 |
- directory: path/to/stage
|
|
59 |
- |
|
60 | 57 |
# Specify the ref. It is a list of strings of format
|
61 | 58 |
# "<package-name>==<version>", separated by "\\n".
|
62 | 59 |
# Usually this will be contents of a requirements.txt file where all
|
63 | 60 |
# package versions have been frozen.
|
64 | 61 |
ref: "flake8==3.5.0\\nmccabe==0.6.1\\npkg-resources==0.0.0\\npycodestyle==2.3.1\\npyflakes==1.6.0"
|
65 | 62 |
|
63 |
+See :ref:`built-in functionality doumentation <core_source_builtins>` for
|
|
64 |
+details on common configuration options for sources.
|
|
65 |
+ |
|
66 | 66 |
.. note::
|
67 | 67 |
|
68 | 68 |
The ``pip`` plugin is available since :ref:`format version 16 <project_format_version>`
|
69 |
- |
|
70 | 69 |
"""
|
71 | 70 |
|
72 | 71 |
import errno
|
... | ... | @@ -28,9 +28,6 @@ remote - stage files from remote urls |
28 | 28 |
# Specify the remote source kind
|
29 | 29 |
kind: remote
|
30 | 30 |
|
31 |
- # Optionally specify a relative staging directory
|
|
32 |
- # directory: path/to/stage
|
|
33 |
- |
|
34 | 31 |
# Optionally specify a relative staging filename.
|
35 | 32 |
# If not specified, the basename of the url will be used.
|
36 | 33 |
# filename: customfilename
|
... | ... | @@ -47,12 +44,12 @@ remote - stage files from remote urls |
47 | 44 |
# Specify the ref. It's a sha256sum of the file you download.
|
48 | 45 |
ref: 6c9f6f68a131ec6381da82f2bff978083ed7f4f7991d931bfa767b7965ebc94b
|
49 | 46 |
|
50 |
- |
|
47 |
+See :ref:`built-in functionality doumentation <core_source_builtins>` for
|
|
48 |
+details on common configuration options for sources.
|
|
51 | 49 |
|
52 | 50 |
.. note::
|
53 | 51 |
|
54 | 52 |
The ``remote`` plugin is available since :ref:`format version 10 <project_format_version>`
|
55 |
- |
|
56 | 53 |
"""
|
57 | 54 |
import os
|
58 | 55 |
from buildstream import SourceError, utils
|
... | ... | @@ -32,9 +32,6 @@ tar - stage files from tar archives |
32 | 32 |
# Specify the tar source kind
|
33 | 33 |
kind: tar
|
34 | 34 |
|
35 |
- # Optionally specify a relative staging directory
|
|
36 |
- # directory: path/to/stage
|
|
37 |
- |
|
38 | 35 |
# Specify the tar url. Using an alias defined in your project
|
39 | 36 |
# configuration is encouraged. 'bst track' will update the
|
40 | 37 |
# sha256sum in 'ref' to the downloaded file's sha256sum.
|
... | ... | @@ -53,6 +50,9 @@ tar - stage files from tar archives |
53 | 50 |
# To extract the root of the tarball directly, this can be set
|
54 | 51 |
# to an empty string.
|
55 | 52 |
base-dir: '*'
|
53 |
+ |
|
54 |
+See :ref:`built-in functionality doumentation <core_source_builtins>` for
|
|
55 |
+details on common configuration options for sources.
|
|
56 | 56 |
"""
|
57 | 57 |
|
58 | 58 |
import os
|
... | ... | @@ -28,9 +28,6 @@ zip - stage files from zip archives |
28 | 28 |
# Specify the zip source kind
|
29 | 29 |
kind: zip
|
30 | 30 |
|
31 |
- # Optionally specify a relative staging directory
|
|
32 |
- # directory: path/to/stage
|
|
33 |
- |
|
34 | 31 |
# Specify the zip url. Using an alias defined in your project
|
35 | 32 |
# configuration is encouraged. 'bst track' will update the
|
36 | 33 |
# sha256sum in 'ref' to the downloaded file's sha256sum.
|
... | ... | @@ -50,11 +47,13 @@ zip - stage files from zip archives |
50 | 47 |
# to an empty string.
|
51 | 48 |
base-dir: '*'
|
52 | 49 |
|
50 |
+See :ref:`built-in functionality doumentation <core_source_builtins>` for
|
|
51 |
+details on common configuration options for sources.
|
|
52 |
+ |
|
53 | 53 |
.. attention::
|
54 | 54 |
|
55 | 55 |
File permissions are not preserved. All extracted directories have
|
56 | 56 |
permissions 0755 and all extracted files have permissions 0644.
|
57 |
- |
|
58 | 57 |
"""
|
59 | 58 |
|
60 | 59 |
import os
|
... | ... | @@ -20,6 +20,8 @@ |
20 | 20 |
Source - Base source class
|
21 | 21 |
==========================
|
22 | 22 |
|
23 |
+.. _core_source_builtins:
|
|
24 |
+ |
|
23 | 25 |
Built-in functionality
|
24 | 26 |
----------------------
|
25 | 27 |
|