Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
56a9903
Created new test_runner.c and test_.py
geky Apr 16, 2022
d683f1c
Reintroduced test-defines into the new test_runner
geky Apr 18, 2022
4b0aa62
Some more minor improvements to the test_runner
geky Apr 18, 2022
9281ce2
More test_runner progress
geky Apr 18, 2022
92a600a
Added trace and persist flags to test_runner
geky Apr 19, 2022
6443693
Putting together rewritten test.py script
geky Apr 24, 2022
5812d2b
Reworked how multi-layered defines work in the test-runner
geky Apr 25, 2022
5ee4b05
Misc test-runner improvements
geky Apr 25, 2022
4962829
Continued progress toward feature parity with new test-runner
geky May 1, 2022
be0e6ad
More progress toward test-runner feature parity
geky May 2, 2022
5a572ce
Reworked how test defines are implemented to support recursion
geky May 8, 2022
d679fbb
In ./scripts/test.py, readded external commands, tweaked subprocesses
geky May 8, 2022
0781f50
Ported tests to new framework
geky May 14, 2022
4a42326
Moved test suites into custom linker section
geky May 14, 2022
1616115
Fix test.py hang on ctrl-C, cleanup TODOs
geky May 15, 2022
2b11f2b
Tweaked generation of .cgi files, error code for recursion in stack.py
geky May 15, 2022
4a7e94f
Reimplemented coverage.py, using only gcov and with line+branch coverage
geky May 16, 2022
5b0a6d4
Reworked scripts to move field details into classes
geky May 21, 2022
46cc6d4
Added support for annotated source in coverage.py
geky May 23, 2022
92eee8e
Removed some prefixes from Makefile variables where not necessary
geky Aug 15, 2022
b08463f
Reworked scripts/pretty_asserts.py a bit
geky Aug 16, 2022
a368d3a
Moved emulation of erase values up into lfs_testbd
geky Aug 17, 2022
01b11da
Added a simple test that the block device works
geky Aug 17, 2022
61455b6
Added back heuristic-based power-loss testing
geky Aug 19, 2022
4689678
Added --color to test.py, fixed some terminal-clobbering issues
geky Aug 22, 2022
3f4f859
Readded support for mirror writes to a file in testbd
geky Aug 23, 2022
552336e
Added optional read/prog/erase delays to testbd
geky Aug 23, 2022
5279fc6
Implemented exhaustive testing of n nested powerlosses
geky Aug 25, 2022
c9a6e3a
Added tailpipe.py and improved redirecting test trace/log output over…
geky Aug 27, 2022
91200e6
Added tracebd.py, a script for rendering block device operations
geky Sep 2, 2022
a208d84
Reworked test defines a bit to use one common array layout
geky Sep 6, 2022
c7f7094
Several tweaks to test.py and test runner
geky Sep 9, 2022
5a2ff17
Changed test identifier separator # -> :
geky Sep 9, 2022
bfbe44e
Dropped permutation number for full leb16-encoded defines
geky Sep 10, 2022
03c1a4e
Added permutations and ranges to test defines
geky Sep 11, 2022
23fba40
Added option for updating a CSV file with test results
geky Sep 12, 2022
acdea18
Made summary.py more powerful, dropped -m from size scripts
geky Sep 14, 2022
1fcd82d
Made test.py output parsable by summary.py
geky Sep 16, 2022
11d6d12
Dropped namespacing of test cases
geky Sep 17, 2022
20ec0be
Cleaned up a number of small tweaks in the scripts
geky Sep 19, 2022
4fe0738
Added bench.py and bench_runner.c for benchmarking
geky Sep 20, 2022
9a0e3be
Added a quick trie to avoid running redundant test/bench permutations
geky Sep 20, 2022
7591d9c
Added plot.py for in-terminal plotting
geky Sep 22, 2022
fb58148
Consistent handling of by/field arguments for plot.py and summary.py
geky Sep 23, 2022
42d889e
Reworked/simplified tracebd.py a bit
geky Sep 25, 2022
9507e62
Several tweaks to script flags
geky Sep 27, 2022
a2fb708
Added stddev/gmean/gstddev to summary.py
geky Sep 27, 2022
274222b
Added some automatic sizing for field-names in scripts/runners
geky Sep 27, 2022
296c5af
Renamed bench_read/prog/erased -> bench_readed/proged/erased
geky Sep 27, 2022
ca66993
Tweaked scripts to share more code, added coverage calls/hits
geky Oct 2, 2022
490e1c4
Added perf.py a wrapper around Linux's perf tool for perf sampling
geky Oct 2, 2022
df283ae
Added recursive results to perf.py
geky Oct 9, 2022
29cbafe
Renamed coverage.py -> cov.py
geky Oct 9, 2022
3a33c37
Added perfbd.py and block device performance sampling in bench-runner
geky Oct 13, 2022
b2a2cc9
Added teepipe.py and watch.py
geky Oct 16, 2022
559e174
Added plotmpl.py for creating svg/png plots with matplotlib
geky Oct 20, 2022
6fce9e5
Changed plotmpl.py/plot.py to not treat missing values as discontinui…
geky Nov 10, 2022
1a07c2c
A number of small script fixes/tweaks from usage
geky Nov 11, 2022
e35e078
Renamed prefix.py -> changeprefix.py and updated to use argparse
geky Nov 16, 2022
bcc88f5
A couple Makefile-related tweaks
geky Nov 17, 2022
f734941
Changed default build target lfs.a -> liblfs.a
geky Nov 17, 2022
6c18b4d
Added a simple help rule to the Makefile
geky Nov 17, 2022
f89d758
Fixed test out-of-space issues with powerloss testing
geky Nov 28, 2022
eba5553
Fixed hidden orphans by separating deorphan search into two passes
geky Nov 28, 2022
0b11ce0
Fixed incorrect calculation of extra space needed in mdir blocks
geky Nov 19, 2022
387cf6f
Fixed a couple corner cases in scripts when fields are empty
geky Nov 19, 2022
65923cd
Adopted script changes in GitHub Actions
geky Nov 17, 2022
397aa27
Removed unnecessarily heavy RAM usage from logs in bench/test.py
geky Nov 23, 2022
a659c02
Added a bot-generated PR-comment with a simple status table
geky Nov 23, 2022
4a20934
Fixed bench workflow + changeprefix issue in prefix releases
geky Nov 27, 2022
0c781dd
Merge remote-tracking branch 'origin/master' into test-and-bench-runners
geky Dec 7, 2022
9990342
Fixed Clang testing in CI, removed override vars in Makefile
geky Nov 29, 2022
c4b3e9d
A couple of script changes after CI integration
geky Nov 29, 2022
9b687dd
Added make benchmarks/testmarks rules
geky Nov 29, 2022
cda2f6f
Changed test_runner to run with -Pnone,linear by default
geky Nov 30, 2022
d8e7ffb
Changed lfs_emubd_get* -> lfs_emubd_*
geky Nov 30, 2022
b0382fa
Added BENCH/TEST_PRNG, replacing other ad-hoc sources of randomness
geky Nov 30, 2022
2d2dd8b
Added plotmpl.py --github flag to match the website's foreground/back…
geky Dec 2, 2022
cfd4e60
Added --subplot* to plotmpl.py
geky Dec 13, 2022
1f37eb5
Adopted --subplot* in plot.py
geky Dec 15, 2022
801cf27
Tweaked/fixed a number of small runner things after a bit of use
geky Dec 17, 2022
c2147c4
Added --gdb-pl to test.py for breaking on specific powerlosses
geky Dec 10, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .github/workflows/post-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ on:
branches: [master]
types: [released]

defaults:
run:
shell: bash -euv -o pipefail {0}

jobs:
post-release:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
# trigger post-release in dependency repo, this indirection allows the
# dependency repo to be updated often without affecting this repo. At
Expand All @@ -21,6 +25,7 @@ jobs:
event_type: "post-release",
client_payload: {
repo: env.GITHUB_REPOSITORY,
version: "${{github.event.release.tag_name}}"}}' \
| tee /dev/stderr)"
version: "${{github.event.release.tag_name}}",
},
}' | tee /dev/stderr)"

187 changes: 124 additions & 63 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ on:
branches: [master]
types: [completed]

defaults:
run:
shell: bash -euv -o pipefail {0}

jobs:
release:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

# need to manually check for a couple things
# - tests passed?
Expand All @@ -31,8 +35,22 @@ jobs:
with:
workflow: ${{github.event.workflow_run.name}}
run_id: ${{github.event.workflow_run.id}}
name: results
path: results
name: sizes
path: sizes
- uses: dawidd6/action-download-artifact@v2
continue-on-error: true
with:
workflow: ${{github.event.workflow_run.name}}
run_id: ${{github.event.workflow_run.id}}
name: cov
path: cov
- uses: dawidd6/action-download-artifact@v2
continue-on-error: true
with:
workflow: ${{github.event.workflow_run.name}}
run_id: ${{github.event.workflow_run.id}}
name: bench
path: bench

- name: find-version
run: |
Expand Down Expand Up @@ -68,79 +86,119 @@ jobs:
echo "LFS_PREV_VERSION=$LFS_PREV_VERSION" >> $GITHUB_ENV

# try to find results from tests
- name: collect-results
- name: create-table
run: |
# previous results to compare against?
[ -n "$LFS_PREV_VERSION" ] && curl -sS \
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/`
`status/$LFS_PREV_VERSION?per_page=100" \
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/status/$LFS_PREV_VERSION`
`?per_page=100" \
| jq -re 'select(.sha != env.GITHUB_SHA) | .statuses[]' \
>> prev-results.json \
>> prev-status.json \
|| true

# build table for GitHub
echo "<table>" >> results.txt
echo "<thead>" >> results.txt
echo "<tr>" >> results.txt
echo "<th align=left>Configuration</th>" >> results.txt
for r in Code Stack Structs Coverage
do
echo "<th align=right>$r</th>" >> results.txt
done
echo "</tr>" >> results.txt
echo "</thead>" >> results.txt
declare -A table

echo "<tbody>" >> results.txt
# sizes table
i=0
j=0
for c in "" readonly threadsafe migrate error-asserts
do
echo "<tr>" >> results.txt
# per-config results
c_or_default=${c:-default}
echo "<td align=left>${c_or_default^}</td>" >> results.txt
for r in code stack structs
c_camel=${c_or_default^}
table[$i,$j]=$c_camel
((j+=1))

for s in code stack struct
do
# per-config results
echo "<td align=right>" >> results.txt
[ -e results/thumb${c:+-$c}.csv ] && ( \
f=sizes/thumb${c:+-$c}.$s.csv
[ -e $f ] && table[$i,$j]=$( \
export PREV="$(jq -re '
select(.context == "'"results (thumb${c:+, $c}) / $r"'").description
| capture("(?<result>[0-9∞]+)").result' \
prev-results.json || echo 0)"
./scripts/summary.py results/thumb${c:+-$c}.csv -f $r -Y | awk '
NR==2 {printf "%s B",$2}
NR==2 && ENVIRON["PREV"]+0 != 0 {
printf " (%+.1f%%)",100*($2-ENVIRON["PREV"])/ENVIRON["PREV"]}
NR==2 {printf "\n"}' \
| sed -e 's/ /\&nbsp;/g' \
>> results.txt)
echo "</td>" >> results.txt
select(.context == "'"sizes (thumb${c:+, $c}) / $s"'").description
| capture("(?<prev>[0-9∞]+)").prev' \
prev-status.json || echo 0)"
./scripts/summary.py $f --max=stack_limit -Y \
| awk '
NR==2 {$1=0; printf "%s B",$NF}
NR==2 && ENVIRON["PREV"]+0 != 0 {
printf " (%+.1f%%)",100*($NF-ENVIRON["PREV"])/ENVIRON["PREV"]
}' \
| sed -e 's/ /\&nbsp;/g')
((j+=1))
done
# coverage results
if [ -z $c ]
then
echo "<td rowspan=0 align=right>" >> results.txt
[ -e results/coverage.csv ] && ( \
export PREV="$(jq -re '
select(.context == "results / coverage").description
| capture("(?<result>[0-9\\.]+)").result' \
prev-results.json || echo 0)"
./scripts/coverage.py -u results/coverage.csv -Y | awk -F '[ /%]+' '
NR==2 {printf "%.1f%% of %d lines",$4,$3}
((j=0, i+=1))
done

# coverage table
i=0
j=4
for s in lines branches
do
table[$i,$j]=${s^}
((j+=1))

f=cov/cov.csv
[ -e $f ] && table[$i,$j]=$( \
export PREV="$(jq -re '
select(.context == "'"cov / $s"'").description
| capture("(?<prev_a>[0-9]+)/(?<prev_b>[0-9]+)")
| 100*((.prev_a|tonumber) / (.prev_b|tonumber))' \
prev-status.json || echo 0)"
./scripts/cov.py -u $f -f$s -Y \
| awk -F '[ /%]+' -v s=$s '
NR==2 {$1=0; printf "%d/%d %s",$2,$3,s}
NR==2 && ENVIRON["PREV"]+0 != 0 {
printf " (%+.1f%%)",$4-ENVIRON["PREV"]}
NR==2 {printf "\n"}' \
| sed -e 's/ /\&nbsp;/g' \
>> results.txt)
echo "</td>" >> results.txt
fi
echo "</tr>" >> results.txt
printf " (%+.1f%%)",$4-ENVIRON["PREV"]
}' \
| sed -e 's/ /\&nbsp;/g')
((j=4, i+=1))
done
echo "</tbody>" >> results.txt
echo "</table>" >> results.txt

cat results.txt
# benchmark table
i=3
j=4
for s in readed proged erased
do
table[$i,$j]=${s^}
((j+=1))

f=bench/bench.csv
[ -e $f ] && table[$i,$j]=$( \
export PREV="$(jq -re '
select(.context == "'"bench / $s"'").description
| capture("(?<prev>[0-9]+)").prev' \
prev-status.json || echo 0)"
./scripts/summary.py $f -f$s=bench_$s -Y \
| awk '
NR==2 {$1=0; printf "%s B",$NF}
NR==2 && ENVIRON["PREV"]+0 != 0 {
printf " (%+.1f%%)",100*($NF-ENVIRON["PREV"])/ENVIRON["PREV"]
}' \
| sed -e 's/ /\&nbsp;/g')
((j=4, i+=1))
done

# build the actual table
echo "| | Code | Stack | Structs | | Coverage |" >> table.txt
echo "|:--|-----:|------:|--------:|:--|---------:|" >> table.txt
for ((i=0; i<6; i++))
do
echo -n "|" >> table.txt
for ((j=0; j<6; j++))
do
echo -n " " >> table.txt
[[ i -eq 2 && j -eq 5 ]] && echo -n "**Benchmarks**" >> table.txt
echo -n "${table[$i,$j]:-}" >> table.txt
echo -n " |" >> table.txt
done
echo >> table.txt
done

cat table.txt

# find changes from history
- name: collect-changes
- name: create-changes
run: |
[ -n "$LFS_PREV_VERSION" ] || exit 0
# use explicit link to github commit so that release notes can
Expand All @@ -164,7 +222,7 @@ jobs:
git config user.email ${{secrets.BOT_EMAIL}}
git fetch "https://github.com/$GITHUB_REPOSITORY.git" \
"v$LFS_VERSION_MAJOR-prefix" || true
./scripts/prefix.py "lfs$LFS_VERSION_MAJOR"
./scripts/changeprefix.py --git "lfs" "lfs$LFS_VERSION_MAJOR"
git branch "v$LFS_VERSION_MAJOR-prefix" $( \
git commit-tree $(git write-tree) \
$(git rev-parse --verify -q FETCH_HEAD | sed -e 's/^/-p /') \
Expand All @@ -182,15 +240,18 @@ jobs:
run: |
# create release and patch version tag (vN.N.N)
# only draft if not a patch release
[ -e results.txt ] && export RESULTS="$(cat results.txt)"
[ -e changes.txt ] && export CHANGES="$(cat changes.txt)"
[ -e table.txt ] && cat table.txt >> release.txt
echo >> release.txt
[ -e changes.txt ] && cat changes.txt >> release.txt
cat release.txt

curl -sS -X POST -H "authorization: token ${{secrets.BOT_TOKEN}}" \
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/releases" \
-d "$(jq -n '{
-d "$(jq -n --rawfile release release.txt '{
tag_name: env.LFS_VERSION,
name: env.LFS_VERSION | rtrimstr(".0"),
target_commitish: "${{github.event.workflow_run.head_sha}}",
draft: env.LFS_VERSION | endswith(".0"),
body: [env.RESULTS, env.CHANGES | select(.)] | join("\n\n")}' \
| tee /dev/stderr)"
body: $release,
}' | tee /dev/stderr)"

53 changes: 49 additions & 4 deletions .github/workflows/status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ on:
workflows: [test]
types: [completed]

defaults:
run:
shell: bash -euv -o pipefail {0}

jobs:
# forward custom statuses
status:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
# custom statuses?
- uses: dawidd6/action-download-artifact@v2
continue-on-error: true
with:
Expand Down Expand Up @@ -50,6 +54,47 @@ jobs:
state: env.STATE,
context: env.CONTEXT,
description: env.DESCRIPTION,
target_url: env.TARGET_URL}' \
| tee /dev/stderr)"
target_url: env.TARGET_URL,
}' | tee /dev/stderr)"
done

# forward custom pr-comments
comment:
runs-on: ubuntu-22.04

# only run on success (we don't want garbage comments!)
if: ${{github.event.workflow_run.conclusion == 'success'}}

steps:
# generated comment?
- uses: dawidd6/action-download-artifact@v2
continue-on-error: true
with:
workflow: ${{github.event.workflow_run.name}}
run_id: ${{github.event.workflow_run.id}}
name: comment
path: comment
- name: update-comment
continue-on-error: true
run: |
ls comment
for s in $(shopt -s nullglob ; echo comment/*.json)
do
export NUMBER="$(jq -er '.number' $s)"
export BODY="$(jq -er '.body' $s)"

# check that the comment was from the most recent commit on the
# pull request
[ "$(curl -sS -H "authorization: token ${{secrets.BOT_TOKEN}}" \
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/pulls/$NUMBER" \
| jq -er '.head.sha')" \
== ${{github.event.workflow_run.head_sha}} ] || continue

# update comment
curl -sS -X POST -H "authorization: token ${{secrets.BOT_TOKEN}}" \
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/issues/`
`$NUMBER/comments" \
-d "$(jq -n '{
body: env.BODY,
}' | tee /dev/stderr)"
done
Loading