The feature of fuels called fuels-test-helpers is now called test-helpers.
Description
A single place to write all our code checks in the future. All CI checks are now calls to the checks binary. That means if it passes locally 99% your CI is going to pass.
There are three flavors of tests currently:
-f, --flavor <FLAVOR>
Used to enable/disable tests that take too long/are too resource intense [default: normal] [possible values: normal, hack-features, hack-deps]
normal gets you exactly what the CI is going to run. Basically tests, fmt, typos, clippy, check, doc tests, doc links, md anchors, etc, for all packages. Also wasm tests and e2e tests with various combinations of using the binary vs library, type paths vs no type paths.
hack-features will try out every feature combination on each of our workspace members separately while denying warnings. This catches invalid feature combinations and dead code.
hack-deps uses udeps and the nightly compiler to detect dependencies that should be feature-gated.
Planned flavors:
fuzzy checks
compiles with minimum rust
public API breakage
minimal versions of deps used (e.g. 1.4.3 used when we could have used 1.4.1 -- buys flexibility for our users)
check that we don't have more feature flags than we expected (i.e. using optional dependencies for example produces a feature flag)
Running:
Tasks are described in rust over in tasks/builder.rs. Choosing a flavor uses the builder to define what is run for each flavor.
The smallest unit of work is a Task. All tasks are run in parallel (might need to be controlled if you end up having issues due to slower hardware):
This details the ids of the tasks that are to be run as a single job in the CI. Rust should be setup with clippy and fmt, nextest needs to be available and the typos tool. The display name of this job is scripts/fuels-tests-helpers which will show up in the CI GUI.
The CI jobs are formed by grouping all generated tasks by the directory in which they are to be run. This is done so that we reuse the compiled artifacts rather than redo the work in multiple different jobs.
Whatever grouping of tasks we define, checks will unify all their dependencies and list them in the deps part of the CI job config so that the CI can install them.
Checklist
[ ] I have linked to any relevant issues.
[ ] I have updated the documentation.
[x] I have added tests that prove my fix is effective or that my feature works.
Breaking
The feature of
fuels
calledfuels-test-helpers
is now calledtest-helpers
.Description
A single place to write all our code checks in the future. All CI checks are now calls to the
checks
binary. That means if it passes locally 99% your CI is going to pass.There are three flavors of tests currently:
normal
gets you exactly what the CI is going to run. Basically tests, fmt, typos, clippy, check, doc tests, doc links, md anchors, etc, for all packages. Also wasm tests and e2e tests with various combinations of using the binary vs library, type paths vs no type paths.hack-features
will try out every feature combination on each of our workspace members separately while denying warnings. This catches invalid feature combinations and dead code.hack-deps
usesudeps
and the nightly compiler to detect dependencies that should be feature-gated.Planned flavors:
Running: Tasks are described in rust over in
tasks/builder.rs
. Choosing a flavor uses the builder to define what is run for each flavor.The smallest unit of work is a
Task
. All tasks are run in parallel (might need to be controlled if you end up having issues due to slower hardware):cwd
is the folder from which the task is to be runcmd
is defined as:Either a built in check
MdCheck
(this is the unused/missing anchors check) or a custom command. Any future custom logic will extendCommand
.Deps
is defined as:It details what is expected of the environment the tasks are to be run it. This is needed for setting up the CI.
You can list all the tasks available under a flavor by doing:
You can use the CLI further choose tasks by their ID or their cwd.
The output is also written in a way that you can just copy-paste the command to run it in the terminal:
is going to run just fine and produce the same result.
Jobs for the CI are generated by doing:
You'll get a json array for each CI job that is to be run. Example:
This details the ids of the tasks that are to be run as a single job in the CI. Rust should be setup with clippy and fmt, nextest needs to be available and the
typos
tool. The display name of this job isscripts/fuels-tests-helpers
which will show up in the CI GUI.The CI jobs are formed by grouping all generated tasks by the directory in which they are to be run. This is done so that we reuse the compiled artifacts rather than redo the work in multiple different jobs.
Whatever grouping of tasks we define,
checks
will unify all their dependencies and list them in thedeps
part of the CI job config so that the CI can install them.Checklist