Skip to content

Commit f5d2a45

Browse files
committed
ci: Add setup script for running in Flutter "customer testing"
Earlier I'd tried adding this "apt install" command directly in the test registry, as a "setup" line in the "zulip.test" file: flutter/tests#441 But the Flutter "customer testing" suite gets run in two different environments; and it turns out that not only does the LUCI environment not need this step (the Zulip tests there were working fine right up until they were disabled last week due to the failures in GitHub Actions), but it also doesn't permit it: there's no access to `sudo`: https://discord.com/channels/608014603317936148/1290464157765865552/1331449169830871122 https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20customer_testing/22301/overview Error output (reformatted): Processing ./../../bin/cache/pkg/tests/registry/zulip.test... >> sudo apt install -y libsqlite3-dev | sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper ERROR: Setup command failed: sudo apt install -y libsqlite3-dev So we need this bit of conditional logic too. That makes this a little more complex than fits in a "setup" line in the test registry. So instead let's make this script which we can invoke from there.
1 parent 4c04d07 commit f5d2a45

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

tools/customer-testing/setup.sh

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env bash
2+
# Setup script for running Zulip's tests as part of the Flutter
3+
# "customer testing" suite:
4+
# https://github.com/flutter/tests
5+
6+
set -euo pipefail
7+
8+
# Flutter's "customer testing" suite runs in two environments:
9+
# * GitHub Actions for changes to the flutter/tests tree itself
10+
# (which is just a registry of downstream test suites to run);
11+
# * LUCI, at ci.chromium.org, for changes in Flutter.
12+
#
13+
# For background, see:
14+
# https://github.com/flutter/flutter/issues/162041#issuecomment-2611129958
15+
16+
if ! sudo -v; then
17+
# In the LUCI environment sudo isn't available,
18+
# but also the setup below isn't needed. Skip it.
19+
exit 0
20+
fi
21+
22+
# Otherwise, assume we're in the GitHub Actions environment.
23+
24+
25+
# Install libsqlite3-dev.
26+
#
27+
# A few Zulip tests use SQLite, and so need libsqlite3.so.
28+
# (The actual databases involved are tiny and in-memory.)
29+
#
30+
# Both older and newer GitHub Actions images have the SQLite shared
31+
# library, from the libsqlite3-0 package. But newer images
32+
# (ubuntu-24.04, which the ubuntu-latest alias switched to around
33+
# 2025-01) no longer have a symlink "libsqlite3.so" pointing to it,
34+
# which is part of the libsqlite3-dev package. Install that.
35+
sudo apt install -y libsqlite3-dev

0 commit comments

Comments
 (0)