diff --git a/.github/workflows/bash.yml b/.github/workflows/bash.yml deleted file mode 100644 index eb34e3ad76d..00000000000 --- a/.github/workflows/bash.yml +++ /dev/null @@ -1,91 +0,0 @@ -# Workflow for testing multiple bash versions with Docker -name: bash - -on: - workflow_dispatch: - pull_request: - paths-ignore: - - '.github/workflows/*.ya?ml' - - '!.github/workflows/bash.yml' - - 'cylc/flow/etc/syntax/**' - - 'etc/syntax/**' - - 'tests/unit/**' - - 'tests/integration/**' - - '**.md' - - '**/README*/**' - push: - branches: - - master - - '8.*.x' - paths-ignore: - - '.github/workflows/*.ya?ml' - - '!.github/workflows/bash.yml' - - 'cylc/flow/etc/syntax/**' - - 'etc/syntax/**' - - 'tests/unit/**' - - 'tests/integration/**' - - '**.md' - - '**/README*/**' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - bash-docker: - runs-on: ubuntu-latest - timeout-minutes: 15 - strategy: - matrix: - bash-version: - - '3.2' - - '4.2' - # if you use a value like 5.0, YAML will round it to 5, which will cause an error later on - - '5.0' - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Run Docker container - run: | - docker pull ghcr.io/cylc/cylc-bash-testing:master - docker run --name bash -v $(pwd -P):/root/cylc-flow --rm -t -d -m 1G --memory-swap 1G ghcr.io/cylc/cylc-bash-testing:master /bin/bash - docker ps -a - - - name: Install Cylc dependencies in the container - run: | - docker exec bash python3.7 -m pip install six==1.12 - docker exec -w /root/cylc-flow bash python3.7 -m pip install .[all] - - - name: Set the container bash version - run: docker exec bash update-alternatives --set bash /bash/bash-${{ matrix.bash-version }} - - - name: Run functional tests that validate or are related to how Cylc uses bash - run: | - docker exec -w /root/cylc-flow bash \ - ./etc/bin/run-functional-tests -v \ - tests/functional/broadcast/00-simple.t \ - tests/functional/cylc-poll/11-event-time.t \ - tests/functional/cylc-poll/15-job-st-file-no-batch.t \ - tests/functional/events/28-inactivity.t \ - tests/functional/events/34-task-abort.t \ - tests/functional/job-file-trap/00-sigusr1.t \ - tests/functional/job-file-trap/02-pipefail.t \ - tests/functional/job-file-trap/03-user-trap.t \ - tests/functional/jobscript/00-torture.t \ - tests/functional/pause-resume/12-pause-then-retry.t \ - tests/functional/shutdown/09-now2.t \ - tests/functional/shutdown/13-no-port-file-check.t \ - tests/functional/shutdown/14-no-dir-check.t - - - name: Copy cylc-run out of container - if: failure() - run: | - docker cp bash:/root/cylc-run . - - - name: Upload artifact - if: failure() - uses: actions/upload-artifact@v4 - with: - name: 'cylc-run (bash-${{ matrix.bash-version }})' - path: cylc-run diff --git a/.github/workflows/test_fast.yml b/.github/workflows/test_fast.yml deleted file mode 100644 index 5776185557e..00000000000 --- a/.github/workflows/test_fast.yml +++ /dev/null @@ -1,151 +0,0 @@ -name: fast tests - -on: - pull_request: - workflow_dispatch: - push: - branches: - - master - - '8.*.x' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - test: - runs-on: ${{ matrix.os }} - timeout-minutes: 20 - strategy: - fail-fast: false # don't stop on first failure - matrix: - os: ['ubuntu-latest'] - python-version: ['3.7', '3.8', '3.10', '3.11', '3'] - include: - # mac os test - - os: 'macos-11' - python-version: '3.7' # oldest supported version - - # non-utc timezone test - - os: 'ubuntu-latest' - python-version: '3.9' # not the oldest, not the most recent version - time-zone: 'XXX-09:35' - - env: - TZ: ${{ matrix.time-zone }} - PYTEST_ADDOPTS: --cov --cov-append -n 5 --color=yes - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Configure Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Apt-Get Install - if: startsWith(matrix.os, 'ubuntu') - run: | - sudo apt-get update - sudo apt-get install -y sqlite3 - - - name: Install - run: | - pip install -e ."[all]" - - - name: Configure git # Needed by the odd test - uses: cylc/release-actions/configure-git@v1 - - - name: Unit Tests - timeout-minutes: 5 - run: | - pytest cylc/flow tests/unit - - - name: Integration Tests - timeout-minutes: 6 - run: | - pytest tests/integration - - - name: Upload failed tests artifact - if: failure() - uses: actions/upload-artifact@v4 - with: - name: cylc-run (${{ matrix.os }} py-${{ matrix.python-version }}) - path: ~/cylc-run/ - - - name: Coverage report - run: | - coverage xml - coverage report - - - name: Upload coverage artifact - uses: actions/upload-artifact@v4 - with: - name: coverage_${{ matrix.os }}_py-${{ matrix.python-version }} - path: coverage.xml - retention-days: 7 - - lint: - runs-on: 'ubuntu-latest' - timeout-minutes: 10 - steps: - - name: Apt-Get Install - run: | - sudo apt-get update - sudo apt-get install -y shellcheck - - - name: Checkout - uses: actions/checkout@v4 - - # note: exclude python 3.10+ from mypy checks as these produce false - # positives in installed libraries for python 3.7 - - name: Configure Python - uses: actions/setup-python@v5 - with: - python-version: 3.9 - - - name: Install - run: | - pip install -e ."[tests]" - - - name: Flake8 - run: flake8 - - - name: Bandit - run: | - bandit -r --ini .bandit cylc/flow - - - name: Shellchecker - run: etc/bin/shellchecker - - - name: MyPy - run: mypy - - - name: Towncrier - run: towncrier build --draft - - - name: Linkcheck - run: pytest -m linkcheck --dist=load --color=yes -n 10 tests/unit/test_links.py - - codecov: - needs: test - runs-on: ubuntu-latest - timeout-minutes: 2 - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Download coverage artifacts - uses: actions/download-artifact@v4 - - - name: Codecov upload - uses: codecov/codecov-action@v4 - with: - name: ${{ github.workflow }} - flags: fast-tests - fail_ci_if_error: true - verbose: true - # Token not required for public repos, but avoids upload failure due - # to rate-limiting (but not for PRs opened from forks) - token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/test_functional.yml b/.github/workflows/test_functional.yml index f54f3b3d710..c83bbe9db7f 100644 --- a/.github/workflows/test_functional.yml +++ b/.github/workflows/test_functional.yml @@ -33,7 +33,7 @@ concurrency: jobs: test: runs-on: ${{ matrix.os }} - name: ${{ matrix.name || matrix.chunk }} + name: ${{ matrix.name }} timeout-minutes: 45 strategy: fail-fast: false @@ -41,58 +41,12 @@ jobs: os: ['ubuntu-latest'] python-version: ['3.7'] test-base: ['tests/f'] - chunk: ['1/4', '2/4', '3/4', '4/4'] - platform: ['_local_background* _local_at*'] - # NOTE: includes must define ALL of the matrix values - include: - # latest python - - name: 'py-3-latest' - os: 'ubuntu-latest' - python-version: '3' - test-base: 'tests/f' - chunk: '1/4' - platform: '_local_background*' - # tests/k - - name: 'flaky' - os: 'ubuntu-latest' - python-version: '3.7' - test-base: 'tests/k' - chunk: '1/1' - platform: '_local_background* _local_at*' - # remote platforms - - name: '_remote_background_indep_poll' - os: 'ubuntu-latest' - python-version: '3.7' - test-base: 'tests/f tests/k' - chunk: '1/1' - platform: '_remote_background_indep_poll _remote_at_indep_poll' - - name: '_remote_background_indep_tcp' - os: 'ubuntu-latest' - test-base: 'tests/f tests/k' - python-version: '3.7' - chunk: '1/1' - platform: '_remote_background_indep_tcp _remote_at_indep_tcp' - # macos - - name: 'macos 1/5' - os: 'macos-11' - python-version: '3.7' - test-base: 'tests/f' - chunk: '1/5' - platform: '_local_background*' - - name: 'macos 2/5' - os: 'macos-11' - python-version: '3.7' - test-base: 'tests/f' - chunk: '2/5' - platform: '_local_background*' env: # Use non-UTC time zone TZ: XXX-05:30 # these vars are used by etc/bin/run-functional-tests - CYLC_TEST_PLATFORMS: ${{ matrix.platform }} CYLC_COVERAGE: 1 - REMOTE_PLATFORM: ${{ contains(matrix.platform, '_remote') }} steps: - name: Checkout @@ -144,12 +98,15 @@ jobs: mkdir "$HOME/cylc-run" - name: Configure Atrun - if: contains(matrix.platform, '_local_at') run: | PTH="$HOME/.cylc/flow/" mkdir -p "${PTH}" cat > "${PTH}/global.cylc" << __HERE__ [platforms] + [[_local_background_indep_tcp]] + hosts = localhost + install target = localhost + job runner = background [[_local_at_indep_tcp]] hosts = localhost install target = localhost @@ -157,87 +114,16 @@ jobs: __HERE__ cp "${PTH}/global.cylc" "${PTH}/global-tests.cylc" - - name: Swarm Configure - run: | - etc/bin/swarm --yes --debug configure - - - name: Swarm Build - if: env.REMOTE_PLATFORM == 'true' - run: | - # `swarm configure` seems to get ignored so override the user config - cp etc/conf/ssh_config $HOME/.ssh/config - # build and run the swarm - etc/bin/swarm --yes --debug build - etc/bin/swarm --yes --debug run - # test that it's up and running before proceeding - sleep 1 - ssh -vv _remote_background_indep_poll hostname - - - name: Configure git # Needed by the odd test - uses: cylc/release-actions/configure-git@v1 - - - name: Filter Tests - env: - # NOTE: we only want the CHUNK set in this step else we will - # re-chunk tests later when they run - CHUNK: ${{ matrix.chunk }} - run: | - etc/bin/run-functional-tests \ - --dry \ - ${{ matrix.test-base }} \ - > test-file - if [[ $REMOTE_PLATFORM == 'true' ]]; then - # skip tests that don't configure platform requirements - grep -l --color=never REQUIRE_PLATFORM $(cat test-file) > test-file - fi - - name: Test id: test - timeout-minutes: 35 - continue-on-error: true + timeout-minutes: 15 run: | - echo "finished=false" >> $GITHUB_OUTPUT - if [[ '${{ matrix.test-base }}' == 'tests/k' ]]; then - NPROC=4 - else - NPROC=8 - fi - # NOTE: test base is purposefully un-quoted etc/bin/run-functional-tests \ - -j "${NPROC}" \ - --state=save \ - $(cat test-file) \ - || (echo "finished=true" >> $GITHUB_OUTPUT && false) - - - name: Time Out - if: steps.test.outcome == 'failure' && steps.test.outputs.finished != 'true' - run: | - echo '::error:: tests timed-out' - # help to identify the tests that were running at the time - cylc scan --state=all --format=rich --color-blind - # fail the workflow - false - - - name: Re-run failed tests - timeout-minutes: 10 - if: steps.test.outcome == 'failure' && steps.test.outputs.finished == 'true' - run: | - # re-run failed tests providing that they didn't time out first time - # TODO: make the tests deterministic so we don't need to do this - etc/bin/run-functional-tests \ - -j 1 \ -v \ - --state=save,failed $(cat test-file) - - - name: Copy cylc-run out of container - if: failure() && steps.test.outcome == 'failure' && env.REMOTE_PLATFORM == 'true' - run: | - # pick the first host in the list - host="$(cut -d ' ' -f 1 <<< "${{ matrix.platform }}")" - # copy back the remote cylc-run dir - rsync -av \ - "${host}:/root/cylc-run/" \ - "${HOME}/cylc-run/${host}/" + -j 1 \ + -p _local_background_indep_tcp \ + tests/f/spawn-on-demand/19-submitted-compat.t \ + tests/f/optional-outputs/01-stall-on-incomplete.t - name: Debug if: failure() && steps.test.outcome == 'failure' @@ -255,7 +141,7 @@ jobs: id: uploadname run: | # artifact name cannot contain '/' characters - CID="$(sed 's|/|-|g' <<< "${{ matrix.name || matrix.chunk }}")" + CID="$(sed 's|/|-|g' <<< "${{ matrix.name }}")" echo "uploadname=$CID" >> $GITHUB_OUTPUT - name: Upload failed tests artifact @@ -265,27 +151,6 @@ jobs: name: cylc-run (${{ steps.uploadname.outputs.uploadname }}) path: ~/cylc-run/ - - name: Fetch Remote Coverage - if: env.REMOTE_PLATFORM == 'true' - run: | - # pick the first host in the list - host="$(cut -d ' ' -f 1 <<< "${{ matrix.platform }}")" - # copy back the remote coverage files - rsync -av \ - "${host}:/cylc/" \ - '.' \ - --include='.coverage*' \ - --exclude='*' \ - >rsyncout - cat rsyncout - # fiddle the python source location to match the local system - for db in $(grep --color=never '.coverage\.' rsyncout); do - sqlite3 "$db" " - UPDATE file - SET path = REPLACE(path, '/cylc/cylc/', '$PWD/cylc/') - " - done - - name: Shutdown if: always() run: | diff --git a/.github/workflows/test_tutorial_workflow.yml b/.github/workflows/test_tutorial_workflow.yml deleted file mode 100644 index 7859b8588e2..00000000000 --- a/.github/workflows/test_tutorial_workflow.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: test-tutorial-workflow - -on: - push: - branches: - - master - - '8.*.x' - pull_request: - paths-ignore: - - '.github/workflows/*.ya?ml' - - '!.github/workflows/test_tutorial_workflow.yml' - - 'tests/**' - - '**.md' - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - test: - strategy: - matrix: - python-version: ['3.7', '3'] - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - name: configure python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: checkout - uses: actions/checkout@v4 - - - name: Install docs/tutorial dependencies - uses: cylc/cylc-doc/.github/actions/install-dependencies@master - - - name: install cylc-flow - run: pip install .[all] - - - name: run tutorial workflow - timeout-minutes: 6 - run: | - mkdir -p "${HOME}/cylc-run" - etc/bin/run-validate-tutorials - - - name: debug - if: failure() - run: | - find ~/cylc-run -name job.err -exec cat {} + # cylc error files