|
| 1 | +# Run all disabled kickstart tests for tested os variants |
| 2 | +name: Run disabled tests |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + # run after daily-boot-iso.yml |
| 6 | + - cron: 0 4 * * * |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: read |
| 11 | + |
| 12 | +jobs: |
| 13 | + scenario: |
| 14 | + name: Disabled tests |
| 15 | + runs-on: [self-hosted, kstest] |
| 16 | + strategy: |
| 17 | + matrix: |
| 18 | + scenario: [daily-iso, rawhide, rhel9, rhel10, centos10] |
| 19 | + fail-fast: false |
| 20 | + |
| 21 | + timeout-minutes: 140 |
| 22 | + env: |
| 23 | + TEST_JOBS: 16 |
| 24 | + GITHUB_TOKEN: /home/github/github-token |
| 25 | + # The timeout should be ~20 minutes less then the job's timeout-minutes |
| 26 | + # so that we get partial results and logs in case of the timeout. |
| 27 | + LAUNCHER_TIMEOUT_MINUTES: 120 |
| 28 | + |
| 29 | + steps: |
| 30 | + # self-hosted runners don't do this automatically; also useful to keep stuff around for debugging |
| 31 | + # need to run sudo as the launch script and the container create root/other user owned files |
| 32 | + - name: Clean up previous run |
| 33 | + run: | |
| 34 | + sudo podman ps -q --all --filter='ancestor=kstest-runner' | xargs -tr sudo podman rm -f |
| 35 | + sudo podman volume rm --all || true |
| 36 | + sudo rm -rf * |
| 37 | +
|
| 38 | + - name: Clone repository |
| 39 | + uses: actions/checkout@v4 |
| 40 | + with: |
| 41 | + path: kickstart-tests |
| 42 | + |
| 43 | + - name: Generate test cases |
| 44 | + working-directory: ./kickstart-tests |
| 45 | + run: scripts/generate-testcases.py -t ./testlib/test_cases/kstest-template.tc.yaml.j2 . -o ./testlib/test_cases |
| 46 | + |
| 47 | + - name: Clone Permian repository |
| 48 | + uses: actions/checkout@v4 |
| 49 | + with: |
| 50 | + repository: rhinstaller/permian |
| 51 | + path: permian |
| 52 | + ref: main |
| 53 | + |
| 54 | + - name: Clone tplib repository |
| 55 | + uses: actions/checkout@v4 |
| 56 | + with: |
| 57 | + repository: rhinstaller/tplib |
| 58 | + path: tplib |
| 59 | + |
| 60 | + # use the latest official packages for the nightly runs |
| 61 | + - name: Clean up squid cache |
| 62 | + run: sudo containers/squid.sh clean |
| 63 | + working-directory: ./kickstart-tests |
| 64 | + |
| 65 | + - name: Ensure http proxy is running |
| 66 | + run: sudo containers/squid.sh start |
| 67 | + working-directory: ./kickstart-tests |
| 68 | + |
| 69 | + - name: Generate test selection for os variant ${{ matrix.scenario }} |
| 70 | + id: generate_query |
| 71 | + working-directory: ./kickstart-tests |
| 72 | + run: | |
| 73 | + LAUNCH_ARGS=$(scripts/generate-launch-args.py --disabled \ |
| 74 | + --os-variant ${{ matrix.scenario }} ) || RC=$? |
| 75 | + if [ -z ${RC} ] || [ ${RC} == 0 ]; then |
| 76 | + echo "Generated launch arguments: $LAUNCH_ARGS" |
| 77 | + else |
| 78 | + echo "Generating of the arguments failed. See the workflow file for usage." |
| 79 | + exit 1 |
| 80 | + fi |
| 81 | + PERMIAN_QUERY=$(scripts/generate-permian-query.py $LAUNCH_ARGS) |
| 82 | + echo "Generated permian query: $PERMIAN_QUERY" |
| 83 | + echo "query=$PERMIAN_QUERY" >> $GITHUB_OUTPUT |
| 84 | + PLATFORM=$(scripts/generate-permian-query.py --print-platform $LAUNCH_ARGS) |
| 85 | + echo "Generated platform: $PLATFORM" |
| 86 | + echo "platform=$PLATFORM" >> $GITHUB_OUTPUT |
| 87 | +
|
| 88 | + # Fetch boot.iso and configure its local location |
| 89 | + - name: Fetch boot.iso if available for os variant ${{ matrix.scenario }} |
| 90 | + id: boot_iso_for_os_variant |
| 91 | + run: | |
| 92 | + set -eux |
| 93 | + BOOT_ISO_PATH="${{ github.workspace }}/${{ matrix.scenario }}.boot.iso" |
| 94 | + BOOT_ISO_URL="file://$BOOT_ISO_PATH" |
| 95 | + if [ "${{ matrix.scenario }}" == "daily-iso" ]; then |
| 96 | + ${{ github.workspace }}/kickstart-tests/containers/runner/fetch_daily_iso.sh $GITHUB_TOKEN $BOOT_ISO_PATH |
| 97 | + echo "boot_iso=\"bootIso\":{\"x86_64\":\"${BOOT_ISO_URL}\"}," >> $GITHUB_OUTPUT |
| 98 | + elif [ "${{ matrix.scenario }}" == "rawhide" ]; then |
| 99 | + curl -L https://download.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/images/boot.iso --output $BOOT_ISO_PATH |
| 100 | + echo "boot_iso=\"bootIso\":{\"x86_64\":\"${BOOT_ISO_URL}\"}," >> $GITHUB_OUTPUT |
| 101 | + else |
| 102 | + echo "Boot.iso for ${{ matrix.scenario }} can't be fetched." |
| 103 | + echo "boot_iso=" >> $GITHUB_OUTPUT |
| 104 | + fi |
| 105 | +
|
| 106 | + # Configure location of installation repositories for the os variant |
| 107 | + # Also default boot.iso is defined by the value of urls.installation_tree |
| 108 | + # of kstestParams event structure. |
| 109 | + - name: Set installation tree for the os variant |
| 110 | + id: set_installation_urls |
| 111 | + working-directory: ./kickstart-tests |
| 112 | + run: | |
| 113 | + set -eux |
| 114 | + if [ "${{ matrix.scenario }}" == "rhel8" ] || \ |
| 115 | + [ "${{ matrix.scenario }}" == "rhel9" ] || \ |
| 116 | + [ "${{ matrix.scenario }}" == "rhel10" ] || \ |
| 117 | + [ "${{ matrix.scenario }}" == "centos10" ]; then |
| 118 | + source ./scripts/defaults-${{ matrix.scenario }}.sh |
| 119 | + echo "installation_tree=${KSTEST_URL}" >> $GITHUB_OUTPUT |
| 120 | + echo "modular_url=${KSTEST_MODULAR_URL}" >> $GITHUB_OUTPUT |
| 121 | + else |
| 122 | + echo "Installation tree location for ${{ matrix.scenario }} not configured" |
| 123 | + if [ -z "${{ steps.boot_iso_for_os_variant.outputs.boot_iso }}" ]; then |
| 124 | + echo "No boot.iso source is defined" |
| 125 | + exit 2 |
| 126 | + fi |
| 127 | + echo "installation_tree=" >> $GITHUB_OUTPUT |
| 128 | + echo "modular_url=" >> $GITHUB_OUTPUT |
| 129 | + fi |
| 130 | +
|
| 131 | + - name: Create Permian settings file |
| 132 | + working-directory: ./permian |
| 133 | + run: | |
| 134 | + cat <<EOF > settings.ini |
| 135 | + [kickstart_test] |
| 136 | + kstest_local_repo=${{ github.workspace }}/kickstart-tests |
| 137 | + [library] |
| 138 | + directPath=${{ github.workspace }}/kickstart-tests/testlib |
| 139 | + EOF |
| 140 | +
|
| 141 | + - name: Run kickstart tests in container |
| 142 | + working-directory: ./permian |
| 143 | + run: | |
| 144 | + sudo --preserve-env=TEST_JOBS \ |
| 145 | + PYTHONPATH=${PYTHONPATH:-}:${{ github.workspace }}/tplib \ |
| 146 | + ./run_subset --debug-log permian.log \ |
| 147 | + --settings settings.ini \ |
| 148 | + --override workflows.dry_run=False \ |
| 149 | + --testcase-query '${{ steps.generate_query.outputs.query }}' \ |
| 150 | + run_event '{ |
| 151 | + "type":"everything", |
| 152 | + "everything_testplan":{ |
| 153 | + "configurations":[{"architecture":"x86_64"}], |
| 154 | + "point_person":"[email protected]" |
| 155 | + }, |
| 156 | + ${{ steps.boot_iso_for_os_variant.outputs.boot_iso }} |
| 157 | + "kstestParams":{ |
| 158 | + "platform":"${{ steps.generate_query.outputs.platform }}", |
| 159 | + "urls":{ |
| 160 | + "x86_64":{ |
| 161 | + "installation_tree":"${{ steps.set_installation_urls.outputs.installation_tree }}", |
| 162 | + "modular_url":"${{ steps.set_installation_urls.outputs.modular_url }}" |
| 163 | + } |
| 164 | + } |
| 165 | + } |
| 166 | + }' |
| 167 | +
|
| 168 | + # Permian hides the exit code of launcher, so error out this step manually based on logs |
| 169 | + rc=$( awk '/Runner return code: /{ print $4 }' permian.log) |
| 170 | + if [ -n "$rc" ]; then |
| 171 | + exit $rc |
| 172 | + else |
| 173 | + grep -q "All execution and reporting is done" permian.log || exit 111 |
| 174 | + fi |
| 175 | +
|
| 176 | + - name: Collect anaconda logs |
| 177 | + if: always() |
| 178 | + uses: actions/upload-artifact@v4 |
| 179 | + with: |
| 180 | + name: 'logs-${{ matrix.scenario }}' |
| 181 | + # skip the /anaconda subdirectories, too large |
| 182 | + path: | |
| 183 | + kickstart-tests/data/logs/kstest*.log |
| 184 | + kickstart-tests/data/logs/kstest.log.json |
| 185 | + kickstart-tests/data/logs/kstest-*/*.log |
| 186 | + kickstart-tests/data/logs/kstest-*/anaconda/lorax-packages.log |
| 187 | + kickstart-tests/data/logs/kstest-*/original-ks.cfg |
| 188 | +
|
| 189 | + - name: Collect json summary |
| 190 | + if: always() |
| 191 | + uses: actions/upload-artifact@v4 |
| 192 | + with: |
| 193 | + name: 'summary-${{ matrix.scenario }}' |
| 194 | + path: | |
| 195 | + kickstart-tests/data/logs/kstest.log.json |
| 196 | +
|
| 197 | + - name: Collect Permian logs |
| 198 | + if: always() |
| 199 | + uses: actions/upload-artifact@v4 |
| 200 | + with: |
| 201 | + name: 'logs-permian-${{ matrix.scenario }}' |
| 202 | + path: | |
| 203 | + permian/permian.log |
| 204 | +
|
| 205 | + - name: Collect Permian xunit reporter results |
| 206 | + if: always() |
| 207 | + uses: actions/upload-artifact@v4 |
| 208 | + with: |
| 209 | + name: 'results-xunit-${{ matrix.scenario }}' |
| 210 | + path: | |
| 211 | + permian/xunit-*.xml |
0 commit comments