Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-pick to earlgrey_1.0.0: [ci] Introduce a test orchestrator written in bazel #24868

Open
wants to merge 9 commits into
base: earlgrey_1.0.0
Choose a base branch
from

Conversation

github-actions[bot]
Copy link

This is an automatic cherry-pick of #23505 to branch earlgrey_1.0.0.

@jwnrt
Copy link
Contributor

jwnrt commented Oct 24, 2024

Blocked on #24871

pamaury and others added 9 commits November 20, 2024 09:54
The commit fundamentally changes how tests are considered for running
in CI. Previously, any test not marked as "manual", "broken" and "skip_in_ci"
would be run in CI in all execution environment for which it is defined. We
then came up with some clever bazel queries to try and avoid running them
in multiple execution environment when not necessary but this is quite fragile.

The approach is very different: when creating the tests using opentitan_test,
we call a new function, called "ci_orchestrator" with the list of all exec_env
for which it is defined. This function then returns a subset of that list that
should be marked with skip_in_ci. The current implementation is that there is
a list of exec_env that are mutually-exclusive (_ONLY_RUN_ONE_IN_CI_SORTED)
and all but one will be skipped: the only one to run will the highest one in
the list. With this approach, we are guaranteed to never run duplicate tests.
If more complicated logic is required, it can always be added to this function.

As a byproduct of this, we can significantly simplify the filtering logic when
running FPGS jobs.

Signed-off-by: Amaury Pouly <[email protected]>
(cherry picked from commit 9d846d6)
The --test_tag_filters option of `bazel test` is very convenient
but is only available for testing and not for querying. This script
takes as input a list of tags in the same fort as test_tag_filters
and runs an equivalent bazel query to list all tests that match.

Signed-off-by: Amaury Pouly <[email protected]>
(cherry picked from commit e906405)
Those tests can run in the ROM_EXT stage which should be preferred.

Signed-off-by: Amaury Pouly <[email protected]>
(cherry picked from commit 8e828bf)
Previously we only tagged then with the exec_env name but for the CI
it is convenient to have a global way of querying all FPGA tests.

Signed-off-by: Amaury Pouly <[email protected]>
(cherry picked from commit 046356b)
With the filter tags filtering logic, it is very easily to create a
situation where some tests are run in several jobs, or to forget running
tests because of a non-exhaustive set of filters.

This commit adds a final CI job that checks the above condition. This
is achieved by downaloding the list of tests run by every job and then
making sure that there are no duplicates. We also check for missing tests
by running a query on all non-broken, non-manual, non-skip_in_ci FPGA tests.

Signed-off-by: Amaury Pouly <[email protected]>
(cherry picked from commit fb58259)
Those tests require the host interface to support serial break but
the CW310 used in the CI do not support it so they always fail. These
tests will need to be changed to the hyperdebug interface.

Signed-off-by: Amaury Pouly <[email protected]>
(cherry picked from commit 8a211ea)
The test rv_dm_mem_access_dev_rv_dm_delayed_enabled is broken.

Signed-off-by: Amaury Pouly <[email protected]>
(cherry picked from commit 1c44deb)
This wasn't present in the cherry-picked commits for the test
orchestrator, but was present on this branch before.

Signed-off-by: James Wainwright <[email protected]>
@jwnrt jwnrt force-pushed the backport-23505-to-earlgrey_1.0.0 branch from 5b1b7a8 to 9005cb4 Compare November 20, 2024 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants