Skip to content

Commit

Permalink
fixes for real run
Browse files Browse the repository at this point in the history
  • Loading branch information
rvykydal committed Mar 12, 2024
1 parent 67a1d8d commit bbcd471
Showing 1 changed file with 122 additions and 110 deletions.
232 changes: 122 additions & 110 deletions .github/workflows/test-platforms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,18 @@ jobs:
LAUNCH_ARGS=$(echo "$BODY" | sed -n '1 s/^[^ ]* *//p' | sed 's/[[:space:]]*$//')
echo "launch arguments are: $LAUNCH_ARGS"
echo "launch_args=${LAUNCH_ARGS}" >> $GITHUB_OUTPUT
# check for dry run mode
DRY_RUN=False
echo "$BODY" | grep -q "/test-platforms-dry" && DRY_RUN=True
echo "Dry run: ${DRY_RUN}"
echo "dry_run=${DRY_RUN}" >> $GITHUB_OUTPUT
outputs:
allowed_user: ${{ steps.check_user_perm.outputs.allowed_user }}
base_ref: ${{ fromJson(steps.pr_api.outputs.data).base.ref }}
sha: ${{ fromJson(steps.pr_api.outputs.data).head.sha }}
launch_args: ${{ steps.parse_launch_args.outputs.launch_args }}
dry_run: ${{ steps.parse_launch_args.outputs.dry_run }}


platform:
Expand All @@ -73,7 +79,8 @@ jobs:
GITHUB_TOKEN: /home/github/github-token
strategy:
matrix:
platform: [daily-iso, rawhide, rhel8, rhel9]
#platform: [daily-iso, rawhide, rhel8, rhel9]
platform: [rawhide]
fail-fast: false

steps:
Expand Down Expand Up @@ -133,7 +140,7 @@ jobs:
echo "changed_tests=${CHANGED_TESTS}" >> $GITHUB_OUTPUT
- name: Get skipped tests for platform ${{ matrix.platform }}
id: get_platform_skiptest
id: get_platform_specs
working-directory: ./kickstart-tests
run: |
set -eux
Expand All @@ -142,15 +149,19 @@ jobs:
if [ ${{ matrix.platform }} == "daily-iso" ]; then
echo "skip_tests=skip-on-fedora" >> $GITHUB_OUTPUT
echo "disabled_testtypes=$SKIP_TESTTYPES_DAILY_ISO" >> $GITHUB_OUTPUT
echo "platform=rawhide" >> $GITHUB_OUTPUT
elif [ ${{ matrix.platform }} == "rawhide" ]; then
echo "skip_tests=skip-on-fedora" >> $GITHUB_OUTPUT
echo "disabled_testtypes=$SKIP_TESTTYPES_RAWHIDE" >> $GITHUB_OUTPUT
echo "platform=rawhide" >> $GITHUB_OUTPUT
elif [ ${{ matrix.platform }} == "rhel8" ]; then
echo "skip_tests=skip-on-rhel,skip-on-rhel-8" >> $GITHUB_OUTPUT
echo "disabled_testtypes=$SKIP_TESTTYPES_RHEL8" >> $GITHUB_OUTPUT
echo "platform=rhel8" >> $GITHUB_OUTPUT
elif [ ${{ matrix.platform }} == "rhel9" ]; then
echo "skip_tests=skip-on-rhel,skip-on-rhel-9" >> $GITHUB_OUTPUT
echo "disabled_testtypes=$SKIP_TESTTYPES_RHEL9" >> $GITHUB_OUTPUT
echo "platform=rhel9" >> $GITHUB_OUTPUT
else
echo "Platform is not supported by kickstart tests yet!"
exit 1
Expand All @@ -163,13 +174,14 @@ jobs:
set -eux
CHANGED_TESTS="${{steps.get_changed_tests.outputs.changed_tests }}"
DISABLED_TESTTYPES="${{ steps.get_platform_skiptest.outputs.disabled_testtypes }}"
DISABLED_TESTTYPES="${{ steps.get_platform_specs.outputs.disabled_testtypes }}"
LAUNCH_ARGS="${{ needs.pr-info.outputs.launch_args }}"
DRY_RUN="${{ needs.pr-info.outputs.dry_run }}"
if [ -n "${LAUNCH_ARGS}" ]; then
echo "description=Running tests required by the PR comment explicitly." >> $GITHUB_OUTPUT
elif [ -n "${CHANGED_TESTS}" ]; then
echo "description=Running tests affected by changes." >> $GITHUB_OUTPUT
echo "description=Running tests affected by changes (excluding disabled)." >> $GITHUB_OUTPUT
LAUNCH_ARGS="${CHANGED_TESTS}"
if [ -n "${DISABLED_TESTTYPES}" ]; then
LAUNCH_ARGS="--skip-testtypes ${DISABLED_TESTTYPES} ${LAUNCH_ARGS}"
Expand All @@ -182,7 +194,7 @@ jobs:
source ./containers/runner/skip-testtypes
PERMIAN_QUERY=$(scripts/generate-permian-query.py \
--skip-testtypes $SKIP_TESTTYPES_ANACONDA_PR \
--skip-testtypes ${{ steps.get_platform_skiptest.outputs.skip_tests }} \
--skip-testtypes ${{ steps.get_platform_specs.outputs.skip_tests }} \
${LAUNCH_ARGS} )
if [ $? == 0 ]; then
echo "launch_args=$LAUNCH_ARGS" >> $GITHUB_OUTPUT
Expand All @@ -206,111 +218,111 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


# Fetch boot.iso and configiure its local location
- name: Fetch boot.iso if available for platform ${{ matrix.platform }}
id: boot_iso_for_platform
run: |
set -eux
BOOT_ISO_PATH="${{ github.workspace }}/${{ matrix.platform }}.boot.iso"
BOOT_ISO_URL="file://$BOOT_ISO_PATH"
if [ "${{ matrix.platform }}" == "daily-iso" ]; then
${{ github.workspace }}/kickstart-tests/containers/runner/fetch_daily_iso.sh $GITHUB_TOKEN $BOOT_ISO_PATH
echo "boot_iso=\"bootIso\":{\"x86_64\":\"${BOOT_ISO_URL}\"}," >> $GITHUB_OUTPUT
elif [ "${{ matrix.platform }}" == "rawhide" ]; then
curl -L https://download.fedoraproject.org/pub/fedora/linux/development/rawhide/Server/x86_64/os/images/boot.iso --output $BOOT_ISO_PATH
echo "boot_iso=\"bootIso\":{\"x86_64\":\"${BOOT_ISO_URL}\"}," >> $GITHUB_OUTPUT
else
echo "Boot.iso for ${{ matrix.platform }} can't be fetched."
echo "boot_iso=" >> $GITHUB_OUTPUT
fi
# Configure location of installation repositories for the platform
# Also default boot.iso is defined by the value of urls.installation_tree
# of kstestParams event structure.
- name: Set installation tree for the platform
id: set_installation_urls
run: |
set -eux
if [ "${{ matrix.platform }}" == "rhel8" ]; then
echo "installation_tree=http://download.eng.bos.redhat.com/rhel-8/nightly/RHEL-8/latest-RHEL-8.10.0/compose/BaseOS/x86_64/os" >> $GITHUB_OUTPUT
echo "modular_url=http://download.eng.bos.redhat.com/rhel-8/nightly/RHEL-8/latest-RHEL-8.10.0/compose/AppStream/x86_64/os" >> $GITHUB_OUTPUT
elif [ "${{ matrix.platform }}" == "rhel9" ]; then
echo "installation_tree=http://download.eng.bos.redhat.com/rhel-9/nightly/RHEL-9/latest-RHEL-9.4.0/compose/BaseOS/x86_64/os" >> $GITHUB_OUTPUT
echo "modular_url=http://download.eng.bos.redhat.com/rhel-9/nightly/RHEL-9/latest-RHEL-9.4.0/compose/AppStream/x86_64/os" >> $GITHUB_OUTPUT
else
echo "Installation tree location for ${{ matrix.platform }} not configured"
if [ -z "${{ steps.boot_iso_for_platform.outputs.boot_iso }}" ]; then
echo "No boot.iso source is defined"
exit 2
fi
echo "installation_tree=" >> $GITHUB_OUTPUT
echo "modular_url=" >> $GITHUB_OUTPUT
fi
- name: Create Permian settings file
working-directory: ./permian
run: |
cat <<EOF > settings.ini
[kickstart_test]
kstest_local_repo=${{ github.workspace }}/kickstart-tests
[library]
directPath=${{ github.workspace }}/kickstart-tests/testlib
EOF
- name: Run kickstart tests in container
working-directory: ./permian
run: |
sudo --preserve-env=TEST_JOBS \
PYTHONPATH=${PYTHONPATH:-}:${{ github.workspace }}/tplib \
./run_subset --debug-log permian.log \
--settings settings.ini \
--override workflows.dry_run=True \
--testcase-query '${{ steps.generate_query.outputs.query }}' \
run_event '{
"type":"everything",
"everything_testplan":{
"configurations":[{"architecture":"x86_64"}],
"point_person":"rvykydal@redhat.com"
},
${{ steps.boot_iso_from_platform.outputs.boot_iso }}
"kstestParams":{
"platform":"${{ matrix.platform }}",
"urls":{
"x86_64":{
"installation_tree":"${{ steps.set_installation_urls.outputs.installation_tree }}",
"modular_url":"${{ steps.set_installation_urls.outputs.modular_url }}"
}
}
}
}'
# Permian hides the exit code of launcher, so error out this step manually based on logs
rc=$( awk '/Runner return code: /{ print $4 }' permian.log)
if [ -n "$rc" ]; then
exit $rc
else
exit 111
fi
- name: Collect anaconda logs
if: always()
uses: actions/upload-artifact@v4
with:
name: 'logs-${{ matrix.platform }}'
# skip the /anaconda subdirectories, too large
path: |
kickstart-tests/data/logs/kstest*.log
kickstart-tests/data/logs/kstest.log.json
kickstart-tests/data/logs/kstest-*/*.log
kickstart-tests/data/logs/kstest-*/anaconda/lorax-packages.log
- name: Collect Permian logs
if: always()
uses: actions/upload-artifact@v4
with:
name: 'logs-permian-${{ matrix.platform }}'
path: |
permian/permian.log
# # Fetch boot.iso and configiure its local location
# - name: Fetch boot.iso if available for platform ${{ matrix.platform }}
# id: boot_iso_for_platform
# run: |
# set -eux
# BOOT_ISO_PATH="${{ github.workspace }}/${{ matrix.platform }}.boot.iso"
# BOOT_ISO_URL="file://$BOOT_ISO_PATH"
# if [ "${{ matrix.platform }}" == "daily-iso" ]; then
# ${{ github.workspace }}/kickstart-tests/containers/runner/fetch_daily_iso.sh $GITHUB_TOKEN $BOOT_ISO_PATH
# echo "boot_iso=\"bootIso\":{\"x86_64\":\"${BOOT_ISO_URL}\"}," >> $GITHUB_OUTPUT
# elif [ "${{ matrix.platform }}" == "rawhide" ]; then
# curl -L https://download.fedoraproject.org/pub/fedora/linux/development/rawhide/Server/x86_64/os/images/boot.iso --output $BOOT_ISO_PATH
# echo "boot_iso=\"bootIso\":{\"x86_64\":\"${BOOT_ISO_URL}\"}," >> $GITHUB_OUTPUT
# else
# echo "Boot.iso for ${{ matrix.platform }} can't be fetched."
# echo "boot_iso=" >> $GITHUB_OUTPUT
# fi
#
# # Configure location of installation repositories for the platform
# # Also default boot.iso is defined by the value of urls.installation_tree
# # of kstestParams event structure.
# - name: Set installation tree for the platform
# id: set_installation_urls
# run: |
# set -eux
# if [ "${{ matrix.platform }}" == "rhel8" ]; then
# echo "installation_tree=http://download.eng.bos.redhat.com/rhel-8/nightly/RHEL-8/latest-RHEL-8.10.0/compose/BaseOS/x86_64/os" >> $GITHUB_OUTPUT
# echo "modular_url=http://download.eng.bos.redhat.com/rhel-8/nightly/RHEL-8/latest-RHEL-8.10.0/compose/AppStream/x86_64/os" >> $GITHUB_OUTPUT
# elif [ "${{ matrix.platform }}" == "rhel9" ]; then
# echo "installation_tree=http://download.eng.bos.redhat.com/rhel-9/nightly/RHEL-9/latest-RHEL-9.4.0/compose/BaseOS/x86_64/os" >> $GITHUB_OUTPUT
# echo "modular_url=http://download.eng.bos.redhat.com/rhel-9/nightly/RHEL-9/latest-RHEL-9.4.0/compose/AppStream/x86_64/os" >> $GITHUB_OUTPUT
# else
# echo "Installation tree location for ${{ matrix.platform }} not configured"
# if [ -z "${{ steps.boot_iso_for_platform.outputs.boot_iso }}" ]; then
# echo "No boot.iso source is defined"
# exit 2
# fi
# echo "installation_tree=" >> $GITHUB_OUTPUT
# echo "modular_url=" >> $GITHUB_OUTPUT
# fi
#
# - name: Create Permian settings file
# working-directory: ./permian
# run: |
# cat <<EOF > settings.ini
# [kickstart_test]
# kstest_local_repo=${{ github.workspace }}/kickstart-tests
# [library]
# directPath=${{ github.workspace }}/kickstart-tests/testlib
# EOF
#
# - name: Run kickstart tests in container
# working-directory: ./permian
# run: |
# sudo --preserve-env=TEST_JOBS \
# PYTHONPATH=${PYTHONPATH:-}:${{ github.workspace }}/tplib \
# ./run_subset --debug-log permian.log \
# --settings settings.ini \
# --override workflows.dry_run=True \
# --testcase-query '${{ steps.generate_query.outputs.query }}' \
# run_event '{
# "type":"everything",
# "everything_testplan":{
# "configurations":[{"architecture":"x86_64"}],
# "point_person":"rvykydal@redhat.com"
# },
# ${{ steps.boot_iso_for_platform.outputs.boot_iso }}
# "kstestParams":{
# "platform":"${{ steps.get_platform_specs.outputs.platform }}",
# "urls":{
# "x86_64":{
# "installation_tree":"${{ steps.set_installation_urls.outputs.installation_tree }}",
# "modular_url":"${{ steps.set_installation_urls.outputs.modular_url }}"
# }
# }
# }
# }'
#
# # Permian hides the exit code of launcher, so error out this step manually based on logs
# rc=$( awk '/Runner return code: /{ print $4 }' permian.log)
# if [ -n "$rc" ]; then
# exit $rc
# else
# grep -q "All execution and reporting is done" permian.log || exit 111
# fi
#
# - name: Collect anaconda logs
# if: always()
# uses: actions/upload-artifact@v4
# with:
# name: 'logs-${{ matrix.platform }}'
# # skip the /anaconda subdirectories, too large
# path: |
# kickstart-tests/data/logs/kstest*.log
# kickstart-tests/data/logs/kstest.log.json
# kickstart-tests/data/logs/kstest-*/*.log
# kickstart-tests/data/logs/kstest-*/anaconda/lorax-packages.log
#
# - name: Collect Permian logs
# if: always()
# uses: actions/upload-artifact@v4
# with:
# name: 'logs-permian-${{ matrix.platform }}'
# path: |
# permian/permian.log

result:
if: ${{ always() }}
Expand Down

0 comments on commit bbcd471

Please sign in to comment.