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

tvb pushed a commit to branch tristan/test-workflows
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit 41d3fe51a64303ee793942642b7f7e068b1bfcc8
Author: Tristan van Berkom <[email protected]>
AuthorDate: Wed Oct 7 15:56:14 2020 +0900

    .github/workflows/ci.yml: Generate test runner script
    
    This allows us to have a more robust scaffolding inside the container
    once it's launched.
    
    Here we:
      - Add some diagnostic info
      - Maximize verbosity of tox invocations, helps to debug if anything goes 
wrong
      - Ensure that we run tox in a login shell, the ubuntu 18.04 breaks at
        the time of installing cython without this change.
---
 .github/workflows/ci.yml | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 74f6e4b..54af9c1 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -78,6 +78,27 @@ jobs:
       # TODO: Have test user pre-created in the test image.
       - name: Run tox inside a container
         run: |
+
+          cat << EOF > runtox.sh
+          #!/bin/bash
+
+          # Create user
+          useradd -Um buildstream
+          chown -R buildstream:buildstream .
+
+          # Diagnostics
+          echo "Running diagnostics checks"
+          mount
+          df -h
+          tox --version
+
+          # Run tox as user, ensure we have a login shell
+          echo "Running tests"
+          su buildstream -c '/bin/bash --login -c "tox -vvvvv -- $PYTEST_ARGS"'
+          EOF
+
+          chmod +x runtox.sh
+
           docker run \
               --privileged \
               --device /dev/fuse \
@@ -87,7 +108,7 @@ jobs:
               --volume /home/runner/work:/__w \
               --workdir /__w/buildstream/buildstream \
               "$CI_IMAGE_PREFIX"-${{ matrix.image-name || matrix.test-name 
}}-"$CI_IMAGE_SUFFIX" \
-              bash -c 'useradd -Um buildstream && chown -R 
buildstream:buildstream . && su buildstream -c "tox -- $PYTEST_ARGS"'
+              ./runtox.sh
 
   tests-fedora-missing-deps:
     runs-on: ubuntu-20.04

Reply via email to