Skip to content

Commit bde9126

Browse files
AgeManningpaulhaunerrealbigseanantondlr
committed
Ultra Fast Super Slick CI (#4755)
Attempting to improve our CI speeds as its recently been a pain point. Major changes: - Use a github action to pull stable/nightly rust rather than building it each run - Shift test suite to `nexttest` https://github.com/nextest-rs/nextest for CI UPDATE: So I've iterated on some changes, and although I think its still not optimal I think this is a good base to start from. Some extra things in this PR: - Shifted where we pull rust from. We're now using this thing: https://github.com/moonrepo/setup-rust . It's got some interesting cache's built in, but was not seeing the gains that Jimmy managed to get. In either case tho, it can pull rust, cargofmt, clippy, cargo nexttest all in < 5s. So I think it's worthwhile. - I've grouped a few of the check-like tests into a single test called `code-test`. Although we were using github runners in parallel which may be faster, it just seems wasteful. There were like 4-5 tests, where we would pull lighthouse, compile it, then run an action, like clippy, cargo-audit or fmt. I've grouped these into a single action, so we only compile lighthouse once, then in each step we run the checks. This avoids compiling lighthouse like 5 times. - Ive made doppelganger tests run on our local machines to avoid pulling foundry, building and making lcli which are all now baked into the images. - We have sccache and do not incremental compile lighthouse Misc bonus things: - Cargo update - Fix web3 signer openssl keys which is required after a cargo update - Use mock_instant in an LRU cache test to avoid non-deterministic test - Remove race condition in building web3signer tests There's still some things we could improve on. Such as downloading the EF tests every run and the web3-signer binary, but I've left these to be out of scope of this PR. I think the above are meaningful improvements. Co-authored-by: Paul Hauner <[email protected]> Co-authored-by: realbigsean <[email protected]> Co-authored-by: antondlr <[email protected]>
1 parent 1c98806 commit bde9126

File tree

19 files changed

+616
-475
lines changed

19 files changed

+616
-475
lines changed

.config/nextest.toml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# This is the default config used by nextest. It is embedded in the binary at
2+
# build time. It may be used as a template for .config/nextest.toml.
3+
4+
[store]
5+
# The directory under the workspace root at which nextest-related files are
6+
# written. Profile-specific storage is currently written to dir/<profile-name>.
7+
dir = "target/nextest"
8+
9+
# This section defines the default nextest profile. Custom profiles are layered
10+
# on top of the default profile.
11+
[profile.default]
12+
# "retries" defines the number of times a test should be retried. If set to a
13+
# non-zero value, tests that succeed on a subsequent attempt will be marked as
14+
# non-flaky. Can be overridden through the `--retries` option.
15+
# Examples
16+
# * retries = 3
17+
# * retries = { backoff = "fixed", count = 2, delay = "1s" }
18+
# * retries = { backoff = "exponential", count = 10, delay = "1s", jitter = true, max-delay = "10s" }
19+
retries = 0
20+
21+
# The number of threads to run tests with. Supported values are either an integer or
22+
# the string "num-cpus". Can be overridden through the `--test-threads` option.
23+
test-threads = "num-cpus"
24+
25+
# The number of threads required for each test. This is generally used in overrides to
26+
# mark certain tests as heavier than others. However, it can also be set as a global parameter.
27+
threads-required = 1
28+
29+
# Show these test statuses in the output.
30+
#
31+
# The possible values this can take are:
32+
# * none: no output
33+
# * fail: show failed (including exec-failed) tests
34+
# * retry: show flaky and retried tests
35+
# * slow: show slow tests
36+
# * pass: show passed tests
37+
# * skip: show skipped tests (most useful for CI)
38+
# * all: all of the above
39+
#
40+
# Each value includes all the values above it; for example, "slow" includes
41+
# failed and retried tests.
42+
#
43+
# Can be overridden through the `--status-level` flag.
44+
status-level = "pass"
45+
46+
# Similar to status-level, show these test statuses at the end of the run.
47+
final-status-level = "flaky"
48+
49+
# "failure-output" defines when standard output and standard error for failing tests are produced.
50+
# Accepted values are
51+
# * "immediate": output failures as soon as they happen
52+
# * "final": output failures at the end of the test run
53+
# * "immediate-final": output failures as soon as they happen and at the end of
54+
# the test run; combination of "immediate" and "final"
55+
# * "never": don't output failures at all
56+
#
57+
# For large test suites and CI it is generally useful to use "immediate-final".
58+
#
59+
# Can be overridden through the `--failure-output` option.
60+
failure-output = "immediate"
61+
62+
# "success-output" controls production of standard output and standard error on success. This should
63+
# generally be set to "never".
64+
success-output = "never"
65+
66+
# Cancel the test run on the first failure. For CI runs, consider setting this
67+
# to false.
68+
fail-fast = true
69+
70+
# Treat a test that takes longer than the configured 'period' as slow, and print a message.
71+
# See <https://nexte.st/book/slow-tests> for more information.
72+
#
73+
# Optional: specify the parameter 'terminate-after' with a non-zero integer,
74+
# which will cause slow tests to be terminated after the specified number of
75+
# periods have passed.
76+
# Example: slow-timeout = { period = "60s", terminate-after = 2 }
77+
slow-timeout = { period = "120s" }
78+
79+
# Treat a test as leaky if after the process is shut down, standard output and standard error
80+
# aren't closed within this duration.
81+
#
82+
# This usually happens in case of a test that creates a child process and lets it inherit those
83+
# handles, but doesn't clean the child process up (especially when it fails).
84+
#
85+
# See <https://nexte.st/book/leaky-tests> for more information.
86+
leak-timeout = "100ms"
87+
88+
[profile.default.junit]
89+
# Output a JUnit report into the given file inside 'store.dir/<profile-name>'.
90+
# If unspecified, JUnit is not written out.
91+
92+
# path = "junit.xml"
93+
94+
# The name of the top-level "report" element in JUnit report. If aggregating
95+
# reports across different test runs, it may be useful to provide separate names
96+
# for each report.
97+
report-name = "lighthouse-run"
98+
99+
# Whether standard output and standard error for passing tests should be stored in the JUnit report.
100+
# Output is stored in the <system-out> and <system-err> elements of the <testcase> element.
101+
store-success-output = false
102+
103+
# Whether standard output and standard error for failing tests should be stored in the JUnit report.
104+
# Output is stored in the <system-out> and <system-err> elements of the <testcase> element.
105+
#
106+
# Note that if a description can be extracted from the output, it is always stored in the
107+
# <description> element.
108+
store-failure-output = true
109+
110+
# This profile is activated if MIRI_SYSROOT is set.
111+
[profile.default-miri]
112+
# Miri tests take up a lot of memory, so only run 1 test at a time by default.
113+
test-threads = 4

0 commit comments

Comments
 (0)