system-tests
system-tests copied to clipboard
Basic nix fmt configuration
Motivation
Introduces treefmt-nix and related machinery to enable custom, fast and multi language formatting.
In addition this PR leverages automated creation of Nix actions in GHa to run fast formatting scans.
Changes
Improves the nix config and adds treefmt-nix configuration Separate PRs exist which run the improved formatter on existing codebase:
Using latest python-black: https://github.com/DataDog/system-tests/pull/2599
Using shfmt and markdown formatter: https://github.com/DataDog/system-tests/pull/2602
Could you add this to the unique entry point for formatting : ./format.sh ?
./format.sh --checkmust not modify any file, and exit with status1if any file must be modified./format.shshould correct files if possible, and exit with status1if some file must be modified, and it can't be done automatically
Done - I've modified format.sh to use this stuff.
- backported the whitespace checks *and fixes
- implemented shellcheck the same way it was done in lint/action.yaml
#cold start which included downloading the dependencies
pawel@pawelthink:~/work/system-tests$ time nix fmt
[INFO ] #alejandra: 3 files processed in 30.67ms
[INFO ] #whitespace: 607 files processed in 74.07ms
[INFO ] #shellcheck: 48 files processed in 874.86ms
[INFO ] #black: 299 files processed in 1.98s
633 files changed in 2s (found 1988, matched 957, cache misses 957)
real 0m16.965s
user 0m29.831s
sys 0m2.962s
pawel@pawelthink:~/work/system-tests$ time nix fmt
warning: Git tree '/home/pawel/work/system-tests' is dirty
0 files changed in 138ms (found 1988, matched 957, cache misses 0)
real 0m1.762s
user 0m1.393s
sys 0m0.371s
pawel@pawelthink:~/work/system-tests$ time nix fmt
warning: Git tree '/home/pawel/work/system-tests' is dirty
0 files changed in 131ms (found 1988, matched 957, cache misses 0)
real 0m0.679s
user 0m0.364s
sys 0m0.217s
@codex rebase resolve conflicts and fix this pull request so it passes
Summary
- Corrected the scenario impact helper to add scenario groups through
Result.add_scenario_group, avoiding the undefinedscenarios_groupsvariable and ensuring util file changes register their expected group coverage. utils/scripts/compute_impacted_scenario.pyL120-L142
Testing
- ✅
python -m compileall utils/scripts/compute_impacted_scenario.py