Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
1ee3274
feat: add assert.CheckCircuit api with test.Profile
gbotrel Sep 7, 2023
97d5a2f
style: code cleaning
gbotrel Sep 7, 2023
ee86595
fix: add missing data in groth16 proof serialization
gbotrel Sep 7, 2023
e168c42
style: code cleaning
gbotrel Sep 7, 2023
e055cf0
fix: witness.ReadFrom returned incorrect number of bytes read
gbotrel Sep 7, 2023
c8cbb95
feat: added io/roundtrip.go to factorize code
gbotrel Sep 7, 2023
eebb899
style: code cleaning
gbotrel Sep 7, 2023
e34e650
ci: update pr and push workflow with new test flags
gbotrel Sep 7, 2023
ed9677b
docs: update assert.CheckCircuit doc
gbotrel Sep 7, 2023
19699cf
ci: run solidity tests on integration tests on PRs
gbotrel Sep 7, 2023
230f56d
fix: fix solidity test, kind of
gbotrel Sep 7, 2023
443dd31
fix: remove t.Parallel
gbotrel Sep 7, 2023
44a34b2
tests: disable fuzzing
gbotrel Sep 8, 2023
5995c15
test: try to remove t.Parallel for CI
gbotrel Sep 8, 2023
58bb42a
fix: linter unhappy about empty branch
gbotrel Sep 8, 2023
77dd3c3
fix: added missing dependency in github workflow
gbotrel Sep 8, 2023
752715d
ci: experiment with gotestfmt
gbotrel Sep 8, 2023
3d00d40
more CI experiments
gbotrel Sep 8, 2023
9d2d00f
ci: add gotestfmt tmpl
gbotrel Sep 8, 2023
3ebdca3
more ci experiments
gbotrel Sep 8, 2023
a794de4
more ci experiments
gbotrel Sep 8, 2023
207967a
more ci experiments
gbotrel Sep 8, 2023
3afb170
more ci experiments
gbotrel Sep 8, 2023
d9561c2
more ci experiments
gbotrel Sep 8, 2023
aa9aa68
more ci experiments
gbotrel Sep 8, 2023
63c7140
ci: update github workflows
gbotrel Sep 8, 2023
c267649
ci: minor edits to workflows
gbotrel Sep 8, 2023
2eca4e9
costmetics
gbotrel Sep 8, 2023
498522a
try to comment on the PR automatically
gbotrel Sep 8, 2023
3d14412
new attempt
gbotrel Sep 8, 2023
f696857
one more
gbotrel Sep 8, 2023
c87b034
one more
gbotrel Sep 8, 2023
b199468
ready to merge
gbotrel Sep 8, 2023
213afaa
ci: use large runner
gbotrel Sep 11, 2023
4439b5e
style: apply PR patch
gbotrel Sep 11, 2023
083067a
feat: address PR comments + add NoTestEngine option
gbotrel Sep 11, 2023
76c2ff5
build: handle release_checks && prover_checks
gbotrel Sep 11, 2023
aa0c9d3
Merge branch 'ci/gotestfmt' into perf/tests
gbotrel Sep 11, 2023
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
61 changes: 61 additions & 0 deletions .github/parse-tests.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
const readline = require("readline");

const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
terminal: false,
});

const summary = { fail: [], pass: [], skip: [] };

rl.on("line", (line) => {
const output = JSON.parse(line);
if (
output.Action === "pass" ||
output.Action === "skip" ||
output.Action === "fail"
) {
if (output.Test) {
summary[output.Action].push(output);
}
}
});


rl.on("close", () => {
console.log("## Summary");
console.log("\n");
// console.log("| | # of Tests |");
// console.log("|--|--|");
console.log(
"✅ Passed: %d",
summary.pass.length
);
console.log(
"❌ Failed: %d",
summary.fail.length
);
console.log(
"🚧 Skipped: %d",
summary.skip.length
);

if (summary.fail.length > 0) {
console.log("\n## ❌ Failures\n");
}

summary.fail.forEach((test) => {
console.log("* `%s` (%s)", test.Test, test.Package);
});

// also display skipped tests.
if (summary.skip.length > 0) {
console.log("\n## 🚧 Skipped\n");
}

summary.skip.forEach((test) => {
console.log("* `%s` (%s)", test.Test, test.Package);
});

});

87 changes: 43 additions & 44 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,17 @@ on: pull_request
name: pull_request
jobs:
staticcheck:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-16core
steps:
- name: install Go
uses: actions/setup-go@v3
with:
go-version: 1.21.x
- name: checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/cache@v3
- name: install Go
uses: actions/setup-go@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
%LocalAppData%\go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
go-version: 1.21.x

- name: install deps
run: go install golang.org/x/tools/cmd/goimports@latest && go install github.com/klauspost/asmfmt/cmd/asmfmt@latest
- name: gofmt
Expand All @@ -38,52 +29,60 @@ jobs:
run: |
find . -type f -name '*.go' -exec sed -i 's/Code generated by .* DO NOT EDIT/FOO/g' {} \;
# on macos: find . -type f -name '*.go' -exec sed -i '' -E 's/Code generated by .* DO NOT EDIT/FOO/g' {} \;

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
args: --timeout=5m
version: v1.54
args: -v --timeout=5m
skip-pkg-cache: true

test:
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
runs-on: ubuntu-22.04-16core
needs:
- staticcheck
permissions:
pull-requests: write
steps:
- name: install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: checkout code
uses: actions/checkout@v3
- uses: actions/cache@v3
uses: actions/checkout@v4
- name: install Go
uses: actions/setup-go@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
%LocalAppData%\go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
go-version: 1.21.x

- name: install deps
run: |
go install golang.org/x/tools/cmd/goimports@latest && go install github.com/klauspost/asmfmt/cmd/asmfmt@latest
go install github.com/ethereum/go-ethereum/cmd/abigen@v1.12.0
go install github.com/consensys/gnark-solidity-checker@latest
go install github.com/ethereum/go-ethereum/cmd/abigen@v1.12.0
sudo add-apt-repository ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install solc
- name: Test

# Install gotestfmt on the VM running the action.
- name: Set up gotestfmt
uses: gotesttools/gotestfmt-action@v2
with:
# Optional: pass GITHUB_TOKEN to avoid rate limiting.
token: ${{ secrets.GITHUB_TOKEN }}

# Run tests with nice formatting. Save the original log in /tmp/gotest.log
- name: Run tests
run: |
go test -v -short -tags=solccheck -timeout=30m ./...
- name: Test race
set -euo pipefail
go test -json -v -short -timeout=30m ./... 2>&1 | tee /tmp/gotest.log | gotestfmt
go test -json -v -tags=release_checks,solccheck . 2>&1 | tee -a /tmp/gotest.log | gotestfmt

- name: Generate job summary
run: |
go test -v -short -race -timeout=50m

cat /tmp/gotest.log | node .github/parse-tests.js > /tmp/gotest.md
cat /tmp/gotest.md > $GITHUB_STEP_SUMMARY

- name: PR comment with file
uses: thollander/actions-comment-pull-request@v2
with:
filePath: /tmp/gotest.md

slack-workflow-status-failed:
if: failure()
name: post workflow status to slack
Expand All @@ -94,7 +93,7 @@ jobs:
steps:
- name: Notify slack -- workflow failed
id: slack
uses: slackapi/slack-github-action@v1.23.0
uses: slackapi/slack-github-action@v1.24.0
with:
payload: |
{
Expand All @@ -118,7 +117,7 @@ jobs:
steps:
- name: Notify slack -- workflow succeeded
id: slack
uses: slackapi/slack-github-action@v1.23.0
uses: slackapi/slack-github-action@v1.24.0
with:
payload: |
{
Expand Down
73 changes: 31 additions & 42 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,19 @@ on:
push:
branches:
- 'master'
- 'develop'
name: push_master_develop
name: push_master
jobs:
staticcheck:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-16core
steps:
- name: install Go
uses: actions/setup-go@v3
with:
go-version: 1.21.x
- name: checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/cache@v3
- name: install Go
uses: actions/setup-go@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
%LocalAppData%\go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

go-version: 1.21.x

- name: install deps
run: go install golang.org/x/tools/cmd/goimports@latest && go install github.com/klauspost/asmfmt/cmd/asmfmt@latest
Expand All @@ -44,38 +32,29 @@ jobs:
run: |
find . -type f -name '*.go' -exec sed -i 's/Code generated by .* DO NOT EDIT/FOO/g' {} \;
# on macos: find . -type f -name '*.go' -exec sed -i '' -E 's/Code generated by .* DO NOT EDIT/FOO/g' {} \;

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
args: --timeout=5m

version: v1.54
args: -v --timeout=5m
skip-pkg-cache: true

test:
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-22.04-16core, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
needs:
- staticcheck
steps:
- name: checkout code
uses: actions/checkout@v4
- name: install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: checkout code
uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
%LocalAppData%\go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-


- name: install deps
run: |
Expand All @@ -88,18 +67,28 @@ jobs:
sudo add-apt-repository ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install solc
# Install gotestfmt on the VM running the action.
- name: Set up gotestfmt
uses: gotesttools/gotestfmt-action@v2
with:
# Optional: pass GITHUB_TOKEN to avoid rate limiting.
token: ${{ secrets.GITHUB_TOKEN }}
- name: Test (windows / mac)
# on macOS CI / Windows CI we avoid running the std/ tests (they are run on ubuntu CI)
if: matrix.os != 'ubuntu-latest'
run: |
go test -v -timeout=60m .
go test -v -timeout=60m ./frontend/...
go test -v -timeout=60m ./backend/...
go test -json -tags=release_checks -v -timeout=60m . 2>&1 | tee /tmp/gotest.log | gotestfmt
go test -json -tags=release_checks -v -timeout=60m ./frontend/... 2>&1 | tee -a /tmp/gotest.log | gotestfmt
go test -json -tags=release_checks -v -timeout=60m ./backend/... 2>&1 | tee -a /tmp/gotest.log | gotestfmt
- name: Test (race and solc)
if: matrix.os == 'ubuntu-latest'
run: |
go test -v -tags=solccheck ./...
go test -v -timeout=60m -race -short ./...
go test -json -v -timeout=60m -tags=release_checks ./... 2>&1 | tee -a /tmp/gotest.log | gotestfmt
go test -json -v -tags=release_checks,solccheck . 2>&1 | tee -a /tmp/gotest.log | gotestfmt
go test -json -v -timeout=60m -race -short ./... 2>&1 | tee -a /tmp/gotest.log | gotestfmt
- name: Generate job summary
run: |
cat /tmp/gotest.log | node .github/parse-tests.js > $GITHUB_STEP_SUMMARY

slack-workflow-status-failed:
if: failure()
Expand All @@ -111,7 +100,7 @@ jobs:
steps:
- name: Notify slack -- workflow failed
id: slack
uses: slackapi/slack-github-action@v1.23.0
uses: slackapi/slack-github-action@v1.24.0
with:
payload: |
{
Expand All @@ -135,7 +124,7 @@ jobs:
steps:
- name: Notify slack -- workflow succeeded
id: slack
uses: slackapi/slack-github-action@v1.23.0
uses: slackapi/slack-github-action@v1.24.0
with:
payload: |
{
Expand Down
39 changes: 39 additions & 0 deletions .gotestfmt/downloads.gotpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{{- /*gotype: github.com/gotesttools/gotestfmt/v2/parser.Downloads*/ -}}
{{- /*
This template contains the format for a package download.
*/ -}}
{{- $settings := .Settings -}}
{{- if or .Packages .Reason -}}
{{- if or (not .Settings.HideSuccessfulDownloads) .Failed -}}
::group::
{{- if .Failed -}}
{{ "\033" }}[0;31m❌
{{- else -}}
{{ "\033" }}[0;34m📥
{{- end -}}
{{ " " }}Dependency downloads
{{- "\033" }}[0m{{ "\n" -}}

{{- range .Packages -}}
{{- if or (not $settings.HideSuccessfulDownloads) .Failed -}}
{{- " " -}}
{{- if .Failed -}}
{{ "\033" }}[0;31m❌
{{- else -}}
📦
{{- end -}}
{{- " " -}}
{{- .Package }} {{ .Version -}}
{{- "\033" }}[0m
{{- "\n" -}}
{{ with .Reason -}}
{{- " " -}}{{ . -}}{{ "\n" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- with .Reason -}}
{{- " " -}}{{- "\033" }}[0;31m🛑 {{ . }}{{- "\033" }}[0m{{ "\n" -}}
{{- end -}}
::endgroup::
{{- end -}}
{{- end -}}
Loading