ci: Update result tracking with new golden format#2706
Conversation
cf68937 to
d773d37
Compare
fe486da to
f6f47e4
Compare
8767292 to
f6f47e4
Compare
The primary goal of this commit is to improve CI tracking by introducing a new golden format that can differentiate test results based on command-line arguments. To cleanly extract and pass these arguments into the JSON result outputs, the command-line parsing infrastructure across the CTS required a significant refactoring. Key changes include: * Enhanced CI Tracking: Updates `ci/compare_results.py`, `ci/pocl/golden.json`, and `saveResultsToJson` to include and evaluate an `args` key. The golden JSON now uses a nested format mapping specific argument strings (e.g., `--wimpy -1`) to their expected results, allowing the CI to validate the same binary run under different parameters. * Centralized Parsing Infrastructure: Introduces the `ParseArgsFn` callback and `runTestHarnessWithCheckAndParse`. This offloads custom argument parsing from individual test `main()` functions and safely extracts the arguments used so they can be logged by the test harness. * Help Text Consolidation: Replaces fragmented `printUsage()` functions with unified `help` string references populated directly by the standard parsing callbacks. [run-test: test_computeinfo] [run-test: test_bruteforce -1 -w] [run-test: test_cl_copy_images small_images --num-worker-threads 2 1D] [run-test: test_image_streams 1D --num-worker-threads 2 CL_R CL_FILTER_NEAREST]
|
ref #2723 |
|
Hi @rjodinchr, is it possible to separate the work into multiple commits, e.g. one for each of the bullet points you listed in the description. There is a lot of value in your recent PRs but they can be exhuasting to review because of the volume of unrelated/non-core changes required. |
I understand the difficulty of reviewing such a large PR. I can suggest the following strategy for the review:
The harness which is the core of this PR should not be too big to start with: |
| else if (!strcmp(argv[i], "--wimpy") || !strcmp(argv[i], "-w")) | ||
| { | ||
| delArg++; | ||
| removed_args.push_back("--wimpy"); |
There was a problem hiding this comment.
Why is this the only argument that gets pushed back as a hardcoded string and not argv[i]?
There was a problem hiding this comment.
This ensures consistency, as we don't need both -w and --wimpy to be reported. It forces all reports to use a single format so that two identical runs aren't mistaken for being different just because they used different naming conventions.
| if (!help) | ||
| { | ||
| help = true; | ||
| removed_args.push_back("--help"); |
There was a problem hiding this comment.
And this one too I guess.
There was a problem hiding this comment.
Same as for wimpy, even so I believe it is less of a problem with the help argument.
| cl_command_queue_properties queueProps, | ||
| DeviceCheckFn deviceCheckFn); | ||
|
|
||
| typedef test_status (*ParseArgsFn)(int &argc, const char *argv[], |
There was a problem hiding this comment.
Personal perference but I think using is easier to read for functions, i.e.
using ParseArgsFn = test_status (*)(
int &argc,
const char *argv[],
std::vector<std::string> &removed_args,
std::string &help_description
);
There was a problem hiding this comment.
I'm indifferent. clang-format should be trusted to handle repository requirements. If multiple formats are permitted, we should either configure clang-format to enforce a specific one or simply accept whatever clang-format allows.
| { | ||
| log_info("\n"); | ||
| log_info("**************************\n"); | ||
| log_info("*** !! WARNING !! ***\n"); |
There was a problem hiding this comment.
Nit: this is different than the existing message. I don't mind it, just making sure this was intentional.
There was a problem hiding this comment.
This is intentional. Some tests trigger an additional message when wimpy mode is enabled. I wanted to ensure that any tests not printing an additional message can rely on that message to explicitly signal the warning part that most other messages display.
The primary goal of this commit is to improve CI tracking by
introducing a new golden format that can differentiate test results
based on command-line arguments. To cleanly extract and pass these
arguments into the JSON result outputs, the command-line parsing
infrastructure across the CTS required a significant refactoring.
Key changes include:
ci/compare_results.py,ci/pocl/golden.json, andsaveResultsToJsonto include and evaluatean
argskey. The golden JSON now uses a nested format mappingspecific argument strings (e.g.,
--wimpy -1) to their expectedresults, allowing the CI to validate the same binary run under
different parameters.
ParseArgsFncallback and
runTestHarnessWithCheckAndParse. This offloads customargument parsing from individual test
main()functions and safelyextracts the arguments used so they can be logged by the test harness.
printUsage()functions with unified
helpstring references populated directly bythe standard parsing callbacks.