You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by gi...@apache.org on 2020/12/29 13:10:49 UTC

[buildstream] branch bschubert/add-isolated-tests created (now 6ff95c7)

This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a change to branch bschubert/add-isolated-tests
in repository https://gitbox.apache.org/repos/asf/buildstream.git.


      at 6ff95c7  utils.py: Rework `is_main_process` to allow for running the cli in a subprocess

This branch includes the following new commits:

     new 337c3f9  .gitlab-ci.yml: Add a nightly test that runs each test in a separate subprocess
     new 2745a28  WIP:REMOVEME
     new 6ff95c7  utils.py: Rework `is_main_process` to allow for running the cli in a subprocess

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[buildstream] 02/03: WIP:REMOVEME

Posted by gi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a commit to branch bschubert/add-isolated-tests
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit 2745a2872ebf5df8ace68ddc389868ca1699b759
Author: Benjamin Schubert <bs...@bloomberg.net>
AuthorDate: Mon Dec 9 11:12:41 2019 +0000

    WIP:REMOVEME
---
 .gitlab-ci.yml | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c50bc39..f30c675 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -378,11 +378,6 @@ overnight-isolated:
   - su buildstream -c "${TEST_COMMAND} --forked"
   - su buildstream -c "${TEST_COMMAND} --forked"
 
-  # We need to override the exclusion from the template in order to run on schedules
-  except: []
-  only:
-  - schedules
-
 
 #####################################################
 #                    Post stage                     #


[buildstream] 03/03: utils.py: Rework `is_main_process` to allow for running the cli in a subprocess

Posted by gi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a commit to branch bschubert/add-isolated-tests
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit 6ff95c7495e66ced931a062169504dfb0af5d7c9
Author: Benjamin Schubert <bs...@bloomberg.net>
AuthorDate: Fri Dec 6 18:18:55 2019 +0000

    utils.py: Rework `is_main_process` to allow for running the cli in a subprocess
    
    This will allow us a better isolation for tests, as we would now be able
    to run them in subprocesses.
---
 src/buildstream/_frontend/cli.py |  4 +++-
 src/buildstream/utils.py         | 12 +++++++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/buildstream/_frontend/cli.py b/src/buildstream/_frontend/cli.py
index 051f5d7..5777610 100644
--- a/src/buildstream/_frontend/cli.py
+++ b/src/buildstream/_frontend/cli.py
@@ -10,7 +10,7 @@ from .._exceptions import BstError, LoadError, AppError
 from .._versions import BST_FORMAT_VERSION
 from .complete import main_bashcomplete, complete_path, CompleteUnhandled
 from ..types import _CacheBuildTrees, _SchedulerErrorAction
-from ..utils import _get_compression, UtilError
+from ..utils import _get_compression, _set_as_main_process, UtilError
 
 
 ##################################################################
@@ -366,6 +366,8 @@ def cli(context, **kwargs):
 
     from .app import App
 
+    _set_as_main_process()
+
     # Create the App, giving it the main arguments
     context.obj = App.create(dict(kwargs))
     context.call_on_close(context.obj.cleanup)
diff --git a/src/buildstream/utils.py b/src/buildstream/utils.py
index b6716a2..a3cd96d 100644
--- a/src/buildstream/utils.py
+++ b/src/buildstream/utils.py
@@ -56,7 +56,8 @@ _ALIAS_SEPARATOR = ":"
 _URI_SCHEMES = ["http", "https", "ftp", "file", "git", "sftp", "ssh"]
 
 # Main process pid
-_MAIN_PID = os.getpid()
+# This is expected to be set by bst `cli()`
+_MAIN_PID = None
 
 # The number of threads in the main process at startup.
 # This is 1 except for certain test environments (xdist/execnet).
@@ -770,6 +771,15 @@ def _pretty_size(size, dec_places=0):
     return "{size:g}{unit}".format(size=round(psize, dec_places), unit=unit)
 
 
+# _set_as_main_process()
+#
+# Mark the current process at the
+#
+def _set_as_main_process():
+    global _MAIN_PID
+    _MAIN_PID = os.getpid()
+
+
 # _is_main_process()
 #
 # Return whether we are in the main process or not.


[buildstream] 01/03: .gitlab-ci.yml: Add a nightly test that runs each test in a separate subprocess

Posted by gi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a commit to branch bschubert/add-isolated-tests
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit 337c3f97c697142f2a40238c692e99a6fc27bad1
Author: Benjamin Schubert <bs...@bloomberg.net>
AuthorDate: Wed Dec 4 14:33:19 2019 +0000

    .gitlab-ci.yml: Add a nightly test that runs each test in a separate subprocess
    
    This helps ensuring we don't have tests that rely on another one in
    order to work.
---
 .gitlab-ci.yml | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 05932c4..c50bc39 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -366,6 +366,24 @@ overnight-tests-no-cache:
   tags:
   - overnight-tests
 
+overnight-isolated:
+  image: registry.gitlab.com/buildstream/buildstream-docker-images/testsuite-fedora:31-master-97748867
+  <<: *tests
+
+  script:
+  - mkdir -p "${INTEGRATION_CACHE}"
+  - useradd -Um buildstream
+  - chown -R buildstream:buildstream .
+
+  - su buildstream -c "${TEST_COMMAND} --forked"
+  - su buildstream -c "${TEST_COMMAND} --forked"
+
+  # We need to override the exclusion from the template in order to run on schedules
+  except: []
+  only:
+  - schedules
+
+
 #####################################################
 #                    Post stage                     #
 #####################################################