-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tools: add scripts for automating tests of old tool revisions
Signed-off-by: Piotr Binkowski <[email protected]>
- Loading branch information
Piotr Binkowski
committed
Oct 22, 2019
1 parent
aecd429
commit be45022
Showing
2 changed files
with
65 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
rm -r ./tests/generated | ||
make generate-tests | ||
|
||
for i in $(seq 0 $1); do | ||
DATE=$(date --date="`date` -$i week" '+%Y-%m-%d %H:%M') | ||
|
||
rm -r ./out/ | ||
rm -rf ./third_party/tools | ||
git submodule update | ||
|
||
echo $DATE | ||
|
||
for d in ./third_party/tools/*/ ; do | ||
pushd $d | ||
git checkout `git rev-list -n 1 --first-parent --before="$DATE" HEAD` | ||
popd | ||
done | ||
|
||
make runners -j`nproc` | ||
|
||
make -j`nproc` | ||
|
||
DNAME=$(date --date="`date` -$i week" '+%Y-%m-%d') | ||
|
||
cp ./out/report/report.csv $DNAME.csv | ||
done | ||
|
||
./tools/csv-analyzer *.csv |
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,35 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import argparse | ||
import csv | ||
import os | ||
|
||
parser = argparse.ArgumentParser() | ||
|
||
parser.add_argument("files", metavar='N', type=str, nargs='+') | ||
|
||
args = parser.parse_args() | ||
|
||
results = {} | ||
|
||
for f in args.files: | ||
name = os.path.splitext(os.path.basename(f))[0] | ||
results[name] = {} | ||
with open(f, newline='') as csvfile: | ||
reader = csv.DictReader(csvfile) | ||
runners = reader.fieldnames[3:] | ||
for runner in runners: | ||
results[name][runner] = 0 | ||
for row in reader: | ||
for runner in runners: | ||
if row[runner] == 'True': | ||
results[name][runner] += 1 | ||
|
||
with open('out.csv', 'w', newline='') as csvfile: | ||
writer = csv.writer(csvfile) | ||
writer.writerow(['date', *runners]) | ||
for d in results: | ||
row = [d] | ||
for runner in runners: | ||
row.append(results[d][runner]) | ||
writer.writerow(row) |