[test_runner] Create --write-logs dir, add default dir to .gitignore

`python3 tools/test.py --write-results ...` fails to run if the default
directory (logs) doesn't exist. Create the directory if it doesn't
exist.

Update .gitignore with the correct default paths of logs.json and
results.json.

Change-Id: Ib1118387195c3bb30b350ef3748e66b4057c57de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269880
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
This commit is contained in:
Ömer Sinan Ağacan 2022-11-15 09:59:08 +00:00 committed by Commit Queue
parent 9e53a1679c
commit c6d69f1b02
2 changed files with 5 additions and 3 deletions

4
.gitignore vendored
View file

@ -102,8 +102,8 @@ tools/xcodebuild
/crash_logs/
/build/config/gclient_args.gni
/pkg/front_end/testcases/old_dills/
/logs.json
/results.json
logs/logs.json
logs/results.json
/async_lazy_debug.so
/dwarf.so
/dwarf_obfuscate.so

View file

@ -635,7 +635,9 @@ class ResultWriter extends EventListener {
final List<Map> _logs = [];
final String _outputDirectory;
ResultWriter(this._outputDirectory);
ResultWriter(this._outputDirectory) {
Directory(_outputDirectory).createSync(recursive: true);
}
void allTestsKnown() {
// Write an empty result log file, that will be overwritten if any tests