forked from lowRISC/opentitan
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] Add a lint to check for unrunnable tests
We have discovered that some unittest have become unrunnable because we added my mistake dependencies that are marked as only compatible with the OT platforms. This means that those unittests are then skipped when running all tests using //... This commit adds a lint to make sure that all tests are compatible with the host platform. Signed-off-by: Amaury Pouly <[email protected]>
- Loading branch information
Showing
3 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
# Copyright lowRISC contributors (OpenTitan project). | ||
# Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set -e | ||
|
||
# Look for all tests are incompatible with host, i.e. unrunnable. | ||
ci/bazelisk.sh cquery 'tests(//sw/device/...)' \ | ||
--output=starlark \ | ||
--starlark:file=ci/scripts/incompatible_targets.cquery \ | ||
| sed '/^$/d' | uniq | sort > output.txt | ||
if [ ! -s output.txt ]; then | ||
echo "The following tests are incompatible with the host platform:" | ||
cat output.txt | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Find all targets that are incompatible with the specified platform | ||
# (i.e. host by default). | ||
def format(target): | ||
if "IncompatiblePlatformProvider" in providers(target): | ||
return target.label | ||
return "" |