Skip to content

Commit

Permalink
tests(e2e): filter out releases with no VM images (#1035)
Browse files Browse the repository at this point in the history
Rather than have the e2e tests failing constantly until an image becomes
available, we can be smarter about it and dynamically exclude the
codename until the Azure CLI reports at least one existing image for it.

Of course, this doesn't directly map to the existence of a customized
image built by our "E2E - Build image templates" workflow -- but it
gives a clue as to when it becomes possible to build such an image.

-----------

This came as a result of the TICS job failing because it couldn't find a
passing E2E job from which to download the PAM coverage, and with us
enabling Oracular tests none of the jobs would actually be passing
anymore (until a Oracular VM template becomes available). This is a
band-aid for that, and hopefully for future occurrences as well.

I've tested this locally (oracular is excluded):
https://github.com/GabrielNagy/adsys/actions/runs/9611677172
  • Loading branch information
GabrielNagy authored Jun 21, 2024
2 parents 379f28f + 5b365ac commit e4965c0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ jobs:
- name: Install needed binaries
run: |
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y distro-info
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y distro-info jq
- uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Build matrix
id: set-supported-releases
run: |
Expand All @@ -49,6 +52,12 @@ jobs:
continue
fi
# Filter out releases with no corresponding Azure images
images="$(az vm image list --publisher Canonical --offer 0001-com-ubuntu-minimal-${r} --all)"
if [ "$(jq '(. | length) == 0' <<<${images})" = "true" ]; then
continue
fi
if [ -n "${releases}" ]; then
releases="${releases}, "
fi
Expand Down
3 changes: 3 additions & 0 deletions e2e/scripts/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ if [[ ! "$(lsmod)" =~ cifs ]]; then
echo "cifs" >> /etc/modules
fi

echo "Disabling unattended-upgrades to avoid unexpected dpkg frontend locks..."
systemctl disable --now unattended-upgrades

echo "Updating DNS resolver to use AD DNS..."
echo "DNS=10.1.0.4" >> /etc/systemd/resolved.conf
systemctl restart systemd-resolved
Expand Down

0 comments on commit e4965c0

Please sign in to comment.