| image: registry.gitlab.com/buildstream/buildstream-docker-images/testsuite-debian:10-${DOCKER_IMAGE_VERSION} |
| |
| cache: |
| key: "$CI_JOB_NAME-" |
| paths: |
| - cache/ |
| |
| stages: |
| - test |
| - post |
| - publish |
| |
| variables: |
| # SAST related variables |
| SAST_DISABLE_DIND: "true" |
| SAST_GOSEC_LEVEL: 2 |
| CI_PROJECT_REPOSITORY_LANGUAGES: "python" |
| |
| # Our own variables |
| # Version of the docker images we should use for all the images. |
| # This is taken from buildstream/buildstream-docker-images |
| DOCKER_IMAGE_VERSION: master-103717922 |
| PYTEST_ADDOPTS: "--color=yes" |
| INTEGRATION_CACHE: "${CI_PROJECT_DIR}/cache/integration-cache" |
| PYTEST_ARGS: "--color=yes --integration -n 2" |
| TEST_COMMAND: "tox -- ${PYTEST_ARGS}" |
| EXTERNAL_TESTS_COMMAND: "tox -e py35-external,py36-external,py37-external -- ${PYTEST_ARGS}" |
| COVERAGE_PREFIX: "${CI_JOB_NAME}." |
| |
| |
| ##################################################### |
| # Test stage # |
| ##################################################### |
| |
| # Run premerge commits |
| # |
| .tests-template: &tests |
| stage: test |
| |
| before_script: |
| # Diagnostics |
| - mount |
| - df -h |
| - tox --version |
| |
| script: |
| - mkdir -p "${INTEGRATION_CACHE}" |
| - useradd -Um buildstream |
| - chown -R buildstream:buildstream . |
| |
| # Run the tests as a simple user to test for permission issues |
| - su buildstream -c "${TEST_COMMAND}" |
| - su buildstream -c "${EXTERNAL_TESTS_COMMAND}" |
| |
| after_script: |
| except: |
| - schedules |
| artifacts: |
| paths: |
| - .coverage-reports |
| |
| tests-remote-execution: |
| allow_failure: true |
| image: registry.gitlab.com/buildstream/buildstream-docker-images/testsuite-fedora:31-${DOCKER_IMAGE_VERSION} |
| <<: *tests |
| before_script: |
| - dnf install -y docker docker-compose |
| - docker-compose --file ${COMPOSE_MANIFEST} up --detach |
| after_script: |
| - docker-compose --file ${COMPOSE_MANIFEST} stop |
| - docker-compose --file ${COMPOSE_MANIFEST} logs |
| - docker-compose --file ${COMPOSE_MANIFEST} down |
| services: |
| - docker:stable-dind |
| variables: |
| DOCKER_HOST: tcp://docker:2375 |
| DOCKER_DRIVER: overlay2 |
| # Required to be able to connect to the docker daemon. See https://gitlab.com/gitlab-org/gitlab-runner/issues/4501 |
| DOCKER_TLS_CERTDIR: "" |
| COMPOSE_MANIFEST: .gitlab-ci/buildgrid-compose.yml |
| ARTIFACT_CACHE_SERVICE: http://docker:50052 |
| REMOTE_EXECUTION_SERVICE: http://docker:50051 |
| SOURCE_CACHE_SERVICE: http://docker:50052 |
| PYTEST_ARGS: "--color=yes --remote-execution" |