The builtin list function `.sort()` sorts the list in-place and returns
None. As this is an invalid type for iteration, use the builtin `sorted`
function, which returns a sorted copy of the list, which we can iterate
over.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
The flag --testcase-root has been renamed to --testsuite-root in
15bc98eb50 twister: rename TestCase -> TestSuite
Fix the --help text to reflect the change.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Use a path relative to the script itself to determine the ZEPHYR_BASE path
instead of relying on the environment variable.
This allows for modules to use the Zephyr kconfiglib without having
ZEPHYR_BASE set in the environment.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
This commit fixes the broken links to the Contribution Guidelines in
the Compliance Check script.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Serial is not required, in some cases it might be set to null or we
might be using serial_pty, so sort existing map file based on ID
instead.
Fixes#45713
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
For some boards, like up_squared and ehl_crb, they need do a
power off/on operation and use bios to load and execute zephyr
test binary, during the power off, it may meet this SerialException,
but the serial object still works well after power on, we can continue
to get all results from serial, so we don't need to close it,
it's ok to ignore this exception.
BTW, even if we ignore this exception here, it doesn't influence twister
function, because if it was really caused by disconnection, the test would
still be judged as failed due to timeout and serial would be closed later
in main thread, it doesn't impact results.
On the contrary, close serial directly in the monitor serial thread, it
will cause later tests failed due to mismatch errors.
Signed-off-by: Chen Peng1 <peng1.chen@intel.com>
Instead of relying on runtime filter to limit scope to emulation
platforms, use the type attribute for each platform and do the filtering
very early on. This will speed things up for tests where we only run on
emulation platforms.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add dt_chosen_has_compat kconfig helper function. This function checks
if a given `chosen` node has a provided compatible string in its
compatible list. Returns "y" if compatible string is present, and "n"
otherwise.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
When updating `sys.path` to allow importing the pickled edtlib instance,
add the path to the front of `sys.path`, not the end. This ensures that
the `devicetree.edtlib` module that is imported is the one relative
to the files being run, not some other version which may exist on the
path.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Now that we have partially oerhauled twister in the tree, modify actions
with new options:
- not reporting filtered tests is now default
- output is json, not csv
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
For CI and for the condensed version of the report, consider built tests
as passed and do not mark them as skipped. Tests that are built only
will be reported as skipped in the full and suite reports.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Filtered tests are now not being reported by default to allow generation
of reports that are easier to parse and work with in different tools.
The complete filtered set of tests is still available in the json output
for review and verification.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This was forgotten from an early overhaul, fix this as
connected_hardware attribute does not exist anymore.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
We have been generating reports with the platform being used as the
testsuite, ie. all testcases would land under one single big testsuite,
which is very difficult to use or read.
This change uses testsuites as intended and does that for each defined
testsuite (or scenario). Platforms are added as properties among other
things.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
When loading tests from json file we want to reset the reason for those
tests that are to be run and remove whatever we had when the test was
only built.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
we mark built only tests as skipped, however, the type was still the
same as other skipped tests, set this to 'built' to indicate the tests
was only built.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Remove some legacy code and set status and failure/skip reason directly
without set_state and get_state.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Handle build errors due to overflows correctly and do not report those
as failures if not requested.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
When we have a build failure or anything that would prevent execution of
the test, set the status for all subcases accordignly.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
twister now exports json instead of csv, so we make the testplan read
the json data and generate the consolidated plan for the workflow.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Report misconfigued testsuites and subcase parsing issues instead of
erroring out. This should help us fix those tests and then enforce
accurate result capturing.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Remove unused arguments that became obsolete through the refactoring.
- filter_status
- only_failed
- json_report
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Capture failures per testcase so that we can include the output in
reports for only failed testcases and not include the whole log which
can be overwhelming.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Removed tests for dropped functionality.
Renamed classes and files to reflect new structure.
As we refactor the reporting infrastructure, tests will follow once we
have everything in place.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Some complex testsuite use macros and other mean to define testcases
which makes them unparseable. This ends up in a descripency between the
testplan and the test results.
Allow adding the testcases into the yaml and use those instead of
parsing the C files.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
We are now able to capture individual case duration and can display this
as part of the reports instead of using the overall test instance
execution time.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Now we can add the TestCase class which will hold all information about
individual testcases, their status and why they are not passing, etc.
Test cases are parsed initially and testsuite is populated with the list
of testcases it contsins. This list is duplicate for each instance
(scenario) and used to capture test case data.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
More renaming and change to variable names to make it less confusing.
Especially, renames of tc to become ts where applicable.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
TestCase in the old terminology is the test application, but we have
just freed up TestSuite, so use TestSuite here to signify the test
application which consists of many test scenarios and testcases.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Change terminology and fix usage based on the current hierarchy. A
testsuite is each test application we have in the tree. The top class is
where we detect all the test suites and create the testplan to be run
later.
Content of testplan will have to split out, so it only deals with the
plan and not the overall execution of tests. This step will be done at a
later point.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
We now have all the logic for generating data suitable for reports in
one single place (json). The junit reports and in the future other
reports will be using this as input and generate reports using the json
data.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
An obsolete feature that is no longer being used due to the amount of
data that is needed per release and the fact it becomes stale very fast.
Instead, point to files directly for comparison.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Drop CSV generation which was the standard for sharing information since
the early days and instead use json with more content to share
information across sessions and for report generation.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>