Skip to content

Commit

Permalink
now to test on github
Browse files Browse the repository at this point in the history
  • Loading branch information
mike dupont committed Sep 25, 2024
1 parent db5a825 commit 28807f2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
17 changes: 7 additions & 10 deletions README-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -395,24 +395,22 @@ cpu-clock:ppp stats:

# Summary

This set of tools is for batch processing perf data.
This set of tools is for batch collecting and processing performance and coverage data customized for o1js mina.

### Useful Commands

# latest update
We can download an artifact from github using gh ai to basically authenticate a curl for us.

This is an example of downloading an artifact directly, you can find examples in the github build logs for the jobs
`gh api https://api.github.com/repos/meta-introspector/o1js/actions/artifacts/1961929543/zip > data/perf.data.zip`
it contains
perf.data.tar.gz

This contains
`tmp/perf/group.test.ts.perf.data.tar.bz2`
that is mounted in
`/app/perf-reporting/output/`
In This version it contains perf.data.tar.gz, we have evolved the artifact contents so it will change to slightly different names in future versions. This documentation needs to be edited again to reflect that.

That perf data tar gzip contains `tmp/perf/group.test.ts.perf.data.tar.bz2`
that is mounted in `/app/perf-reporting/output/`

it says in the logs
```
wherever you need to run 'perf report' on.
mina-local-network-1 | + cp src/lib/provable/test/provable.test.ts.perf.data src/lib/provable/test/provable.test.ts.perf.data.tar.bz2 src/lib/provable/test/provable.test.ts.reportout.txt /tmp/perf/
mina-local-network-1 | + for testname in $TESTS
mina-local-network-1 | + perf record -o src/lib/provable/test/primitives.test.ts.perf.data -F 999 --call-graph dwarf node --perf-basic-prof ./node_modules/.bin/../jest/bin/jest.js src/lib/provable/test/primitives.test.ts
Expand All @@ -423,7 +421,6 @@ mina-local-network-1 | $ tar xvf src/lib/provable/test/primitives.test.ts.perf.
```


# next step

`perf record -g -F 999 --call-graph dwarf node --perf-basic-prof ./node_modules/.bin/../jest/bin/jest.js src/lib/mina/token.test.ts`
Expand Down
23 changes: 17 additions & 6 deletions run-all-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ echo 2 > /proc/sys/kernel/perf_event_paranoid
# PASS src/lib/mina/precondition.test.ts (12.688 s)
# PASS src/lib/mina/token.test.ts (46.593 s)

TESTS=`ls -b src/lib/provable/test/*.test.ts src/lib/mina/*.test.ts `
TESTS="src/lib/provable/test/merkle-list.test.ts src/lib/provable/test/merkle-tree.test.ts src/lib/provable/test/scalar.test.ts src/lib/provable/test/merkle-map.test.ts src/lib/provable/test/provable.test.ts src/lib/provable/test/primitives.test.ts src/lib/provable/test/group.test.ts src/lib/provable/test/int.test.ts src/lib/mina/precondition.test.ts src/lib/mina/token.test.ts"
# FIXME this all tests is not used because many of them fail.
ALL_TESTS=`ls -b src/lib/provable/test/*.test.ts src/lib/mina/*.test.ts `
#src/lib/provable/test/*unit-test.ts
#src/lib/mina/*.unit-test.ts

Expand All @@ -45,8 +47,9 @@ TESTS=`ls -b src/lib/provable/test/*.test.ts src/lib/mina/*.test.ts `
export NO_INSIGHT=true
export JESTOPTS=--collectCoverage
export NODEOPT1="--prof --expose-gc"
for testname in $TESTS;
do

run_test() {
testname=$1
export MULTIPLE="${testname}"
export perfdata="${testname}.perf.data"
OUTPUT_DIR2="${OUTPUT_DIR}/$testname/"
Expand All @@ -64,15 +67,23 @@ do
perf report -i "${perfdata}" --verbose --stdio --stats > "${perfdata}.stats.txt" 2>&1
perf script -F +pid -i "${perfdata}" > "${perfdata}.script.txt" 2>&1
perf report --stdio -i "${perfdata}" > "${perfdata}.report.txt" 2>&1

ls -latr jit*.dump
rm -r jit*.dump


mv ${testname}.perf.data "${OUTPUT_DIR2}/perf_data"
mv "${testname}.*.txt" "${OUTPUT_DIR2}/perf_data"
mv .clinic/* "${OUTPUT_DIR2}clinic/"
mv coverage/* "${OUTPUT_DIR2}coverage/"
mv *.log "${OUTPUT_DIR2}log/"
mv *.log "${OUTPUT_DIR2}log/"
du -s "${OUTPUT_DIR2}"
find "${OUTPUT_DIR2}"
ls -latr "${OUTPUT_DIR2}"
}

for testname in $TESTS;
do
results=$(run_test $testname)
echo $results
done

tar -czf /tmp/perf.data.tar.gz /tmp/perf/*
Expand Down

0 comments on commit 28807f2

Please sign in to comment.