Skip to content

Commit 9db1272

Browse files
authored
ci: improve the state of some flaky tests (canonical#5899)
Improves/fixes a number of flaky tests. I recommend reviewing per-commit. The integration store tests are currently broken and seem to need store-side fixes, so they will be left out of this PR. The remote build tests are failing for similar reasons. The snapd failures are upstream build errors, which I have alerted the snapd team of.
1 parent 83f961e commit 9db1272

29 files changed

Lines changed: 83 additions & 31 deletions

File tree

.github/workflows/spread-manual.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,3 +225,26 @@ jobs:
225225
- name: Spread test
226226
run: |
227227
spread google:ubuntu-20.04-64:tests/spread/snaps/bases google:ubuntu-20.04-64:tests/spread/snaps/snapd
228+
229+
squid-proxy:
230+
needs: [predicate, snap-build]
231+
if: needs.predicate.outputs.should_run == 'true'
232+
runs-on: [spread-installed]
233+
steps:
234+
- name: Clean up job workspace
235+
run: |
236+
rm -rf "${{ github.workspace }}"
237+
mkdir "${{ github.workspace }}"
238+
- name: Checkout Snapcraft
239+
uses: actions/checkout@v6
240+
with:
241+
fetch-depth: 0
242+
submodules: true
243+
- name: Download snap artifact
244+
uses: actions/download-artifact@v6
245+
with:
246+
name: snap
247+
path: tests
248+
- name: Spread test
249+
run: |
250+
spread google:ubuntu-24.04-64:tests/spread/core24/squid-proxy google:ubuntu-22.04-64:tests/spread/core22/squid-proxy

spread.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ prepare: |
154154
else
155155
tests.pkgs remove lxd
156156
fi
157-
snap install lxd --channel=latest/stable
157+
snap install lxd --channel=5.21/stable
158158
159159
# Hold snap refreshes for 24h.
160160
snap set system refresh.hold="$(date --date=tomorrow +%Y-%m-%dT%H:%M:%S%:z)"

tests/spread/core22/architectures/task.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ prepare: |
1717
1818
restore: |
1919
cd "./snaps/$SNAP"
20-
snapcraft clean
20+
snapcraft clean --destructive-mode
2121
rm -f ./*.snap
2222
2323
#shellcheck source=tests/spread/tools/snapcraft-yaml.sh
@@ -34,7 +34,7 @@ execute: |
3434
# if the arguments variable file exists, then call snapcraft with the arguments
3535
elif [[ -e "arguments.txt" ]]; then
3636
# shellcheck disable=SC2046
37-
eval snapcraft pack --destructive-mode $(cat "arguments.txt")
37+
eval snapcraft pack --destructive-mode $(cat "arguments.txt")
3838
# otherwise, just call `snapcraft pack`
3939
else
4040
snapcraft pack --destructive-mode

tests/spread/core22/components-environment/task.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
summary: Test scriptlets variables on core22 with components
22

33
restore: |
4-
snapcraft clean
4+
snapcraft clean --destructive-mode
55
rm -f ./*.snap
66
77
execute: |

tests/spread/core22/environment/paths/task.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ prepare: |
1313
1414
restore: |
1515
cd "../snaps/$SNAP"
16-
snapcraft clean
16+
snapcraft clean --destructive-mode
1717
rm -f ./*.snap
1818
1919
#shellcheck source=tests/spread/tools/snapcraft-yaml.sh

tests/spread/core22/manifest/manifest-info-cmdline/task.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ prepare: |
44
snap install review-tools
55
66
restore: |
7-
snapcraft clean
7+
# The regular clean can potentially fail depending on if/when the test itself failed, but
8+
# they should always both be attempted
9+
snapcraft clean || true
10+
snapcraft clean --destructive-mode
811
rm -f ./*.snap
912
rm -f ~/manifest_0.1_*.snap
1013

tests/spread/core22/manifest/manifest-info-envvars/task.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ prepare: |
44
snap install review-tools
55
66
restore: |
7-
snapcraft clean
7+
# The regular clean can potentially fail depending on if/when the test itself failed, but
8+
# they should always both be attempted
9+
snapcraft clean || true
10+
snapcraft clean --destructive-mode
811
rm -f ./*.snap
912
rm -f ~/manifest_0.1_*.snap
1013

tests/spread/core22/package-repositories/task.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ environment:
1111
restore: |
1212
cd "$SNAP"
1313
rm -f ./*.snap
14-
snapcraft clean
14+
# The regular clean can potentially fail depending on if/when the test itself failed, but
15+
# they should always both be attempted
16+
snapcraft clean || true
1517
snapcraft clean --destructive-mode
1618
snap remove "${SNAP}"
1719

tests/spread/core22/squid-proxy/task.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
summary: Verify that squid proxy can be passed as an http proxy to snapcraft.
2+
manual: true
23

34
environment:
45
SNAP_DIR: snaps/squid-proxy-test

tests/spread/core24-suites/environment/paths/task.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ systems:
1111

1212
restore: |
1313
cd "../snaps/$SNAP"
14-
snapcraft clean
14+
snapcraft clean --destructive-mode
1515
rm -f ./*.snap
1616
1717
execute: |

0 commit comments

Comments
 (0)