From f52c61e24f0573bc6e26bb10601cf86ba8944b06 Mon Sep 17 00:00:00 2001 From: jrhizor Date: Wed, 15 Feb 2023 14:18:37 -0800 Subject: [PATCH 01/25] initialize stoat --- .github/workflows/e2e.yml | 5 +++++ .github/workflows/examples.yml | 5 +++++ .github/workflows/go.yaml | 10 ++++++++++ .github/workflows/release.yml | 10 ++++++++++ .stoat/config.yaml | 11 +++++++++++ 5 files changed, 41 insertions(+) create mode 100644 .stoat/config.yaml diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 03fd46366a..54335819b7 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -27,3 +27,8 @@ jobs: uses: docker/setup-buildx-action@v2 - name: Run E2E tests run: make e2e + + - name: Run Stoat Action + uses: stoat-dev/stoat-action@v0 + if: always() + diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 450bc79bb0..99c859e5cd 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -14,3 +14,8 @@ jobs: - run: curl -X POST "${{ env.WEBSITE_CLOUDFLARE_DEPLOY_HOOK }}" -v env: WEBSITE_CLOUDFLARE_DEPLOY_HOOK: ${{ secrets.WEBSITE_CLOUDFLARE_DEPLOY_HOOK }} + + - name: Run Stoat Action + uses: stoat-dev/stoat-action@v0 + if: always() + diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index c9931e3930..739a1cd083 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -22,6 +22,11 @@ jobs: run: | curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.50.1 ./bin/golangci-lint run --verbose + + - name: Run Stoat Action + uses: stoat-dev/stoat-action@v0 + if: always() + test: strategy: matrix: @@ -35,3 +40,8 @@ jobs: go-version: 1.18 - name: Test run: go test -race ./... + + - name: Run Stoat Action + uses: stoat-dev/stoat-action@v0 + if: always() + diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fc61f6acda..a8bdd771eb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,6 +34,11 @@ jobs: args: release --rm-dist --debug env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Run Stoat Action + uses: stoat-dev/stoat-action@v0 + if: always() + npm: runs-on: ubuntu-latest needs: [goreleaser] @@ -68,3 +73,8 @@ jobs: env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Run Stoat Action + uses: stoat-dev/stoat-action@v0 + if: always() + + diff --git a/.stoat/config.yaml b/.stoat/config.yaml new file mode 100644 index 0000000000..43bd5cd561 --- /dev/null +++ b/.stoat/config.yaml @@ -0,0 +1,11 @@ +--- +version: 1 +enabled: true +plugins: + job_runtime: + enabled: true +# static_hosting: +# your_unique_id: +# metadata: +# name: "Name of artifact you're hosting, such as Code Coverage Report" +# path: path/from/git/root/to/directory/to/host From e61340d216d88447c178c2888d532dfa6e2d3669 Mon Sep 17 00:00:00 2001 From: jrhizor Date: Wed, 15 Feb 2023 14:36:08 -0800 Subject: [PATCH 02/25] add coverage treemap --- .github/workflows/go.yaml | 8 +++++--- .gitignore | 5 +++++ .stoat/comment.hbs | 1 + .stoat/config.yaml | 9 ++++----- 4 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 .stoat/comment.hbs diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 739a1cd083..050fa11a0f 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -39,9 +39,11 @@ jobs: with: go-version: 1.18 - name: Test - run: go test -race ./... - + run: go test -coverprofile coverage.out -race ./... + - name: Generate Coverage Treemap + run: | + go install github.com/nikolaydubina/go-cover-treemap@latest + go-cover-treemap -h 240 -coverprofile coverage.out > coverage.svg - name: Run Stoat Action uses: stoat-dev/stoat-action@v0 if: always() - diff --git a/.gitignore b/.gitignore index e53e6f591c..b8cf150cdd 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,8 @@ testfns/ main pkg/devserver/index.html + +.DS_Store +.idea +coverage.out +coverage.svg diff --git a/.stoat/comment.hbs b/.stoat/comment.hbs new file mode 100644 index 0000000000..c17906bdc5 --- /dev/null +++ b/.stoat/comment.hbs @@ -0,0 +1 @@ +![test coverage]({{ plugins.static_hosting.coverage.link }}) \ No newline at end of file diff --git a/.stoat/config.yaml b/.stoat/config.yaml index 43bd5cd561..050133563a 100644 --- a/.stoat/config.yaml +++ b/.stoat/config.yaml @@ -1,11 +1,10 @@ --- version: 1 enabled: true +comment_template_file: ".stoat/comment.hbs" plugins: job_runtime: enabled: true -# static_hosting: -# your_unique_id: -# metadata: -# name: "Name of artifact you're hosting, such as Code Coverage Report" -# path: path/from/git/root/to/directory/to/host + static_hosting: + coverage: + path: coverage.svg From 4a91b9a826286745cce2f6ce20850be7cfdccf9f Mon Sep 17 00:00:00 2001 From: jrhizor Date: Wed, 15 Feb 2023 14:52:09 -0800 Subject: [PATCH 03/25] add coverage html link --- .github/workflows/go.yaml | 2 ++ .gitignore | 1 + .stoat/comment.hbs | 2 +- .stoat/config.yaml | 4 +++- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 050fa11a0f..1d501e5f42 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -40,6 +40,8 @@ jobs: go-version: 1.18 - name: Test run: go test -coverprofile coverage.out -race ./... + - name: Generate Coverage HTML + run: go tool cover -o coverage.html -html=coverage.out - name: Generate Coverage Treemap run: | go install github.com/nikolaydubina/go-cover-treemap@latest diff --git a/.gitignore b/.gitignore index b8cf150cdd..a7047bcc94 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ pkg/devserver/index.html .idea coverage.out coverage.svg +coverage.html diff --git a/.stoat/comment.hbs b/.stoat/comment.hbs index c17906bdc5..1fc67f12ed 100644 --- a/.stoat/comment.hbs +++ b/.stoat/comment.hbs @@ -1 +1 @@ -![test coverage]({{ plugins.static_hosting.coverage.link }}) \ No newline at end of file +[![test coverage]({{ plugins.static_hosting.coverage_image.link }})]({{ plugins.static_hosting.coverage_html.link }}) diff --git a/.stoat/config.yaml b/.stoat/config.yaml index 050133563a..ca9cb7dd85 100644 --- a/.stoat/config.yaml +++ b/.stoat/config.yaml @@ -6,5 +6,7 @@ plugins: job_runtime: enabled: true static_hosting: - coverage: + coverage_image: path: coverage.svg + coverage_html: + path: coverage.html From a861f7f93dea7c522215ee8960ddf31c399dc1cf Mon Sep 17 00:00:00 2001 From: jrhizor Date: Wed, 15 Feb 2023 15:36:59 -0800 Subject: [PATCH 04/25] add linter results --- .gitignore | 3 +++ .golangci.json | 9 +++++++++ .stoat/comment.hbs | 6 ++++++ .stoat/config.yaml | 5 +++++ 4 files changed, 23 insertions(+) diff --git a/.gitignore b/.gitignore index a7047bcc94..a2bc75c421 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,6 @@ pkg/devserver/index.html coverage.out coverage.svg coverage.html +golangci.html +golangci.json +bin diff --git a/.golangci.json b/.golangci.json index bac597e4ec..c0ee8890e7 100644 --- a/.golangci.json +++ b/.golangci.json @@ -5,7 +5,16 @@ ], "timeout": "10m" }, + "output": { + "format": "colored-line-number:stdout,html:golangci.html,json:golangci.json" + }, + "linters": { + "enable": ["misspell"] + }, "linters-settings": { + "misspell": { + "ignore-words": [] + }, "staticcheck": { "checks": [ "all", diff --git a/.stoat/comment.hbs b/.stoat/comment.hbs index 1fc67f12ed..fcdb285e92 100644 --- a/.stoat/comment.hbs +++ b/.stoat/comment.hbs @@ -1 +1,7 @@ +{{#if plugins.json.linter.value.Issues.length}} +[![linter](https://img.shields.io/badge/linter-{{ plugins.json.linter.value.Issues.length }}%20issues-red.svg?style=flat)]({{ plugins.static_hosting.linter.link }}) +{{ else }} +[![linter](https://img.shields.io/badge/linter<{{ plugins.static_hosting.linter.sha }}>-passing-brightgreen.svg?style=flat)]({{ plugins.static_hosting.linter.link }}) +{{/if}} + [![test coverage]({{ plugins.static_hosting.coverage_image.link }})]({{ plugins.static_hosting.coverage_html.link }}) diff --git a/.stoat/config.yaml b/.stoat/config.yaml index ca9cb7dd85..643e7495b4 100644 --- a/.stoat/config.yaml +++ b/.stoat/config.yaml @@ -5,8 +5,13 @@ comment_template_file: ".stoat/comment.hbs" plugins: job_runtime: enabled: true + json: + linter: + path: golangci.json static_hosting: coverage_image: path: coverage.svg coverage_html: path: coverage.html + linter: + path: golangci.html From d24d71d565e085a64a7c0593649d2f38001f8427 Mon Sep 17 00:00:00 2001 From: jrhizor Date: Wed, 15 Feb 2023 15:45:19 -0800 Subject: [PATCH 05/25] comment update --- .github/workflows/go.yaml | 2 +- .stoat/comment.hbs | 26 +++++++++++++++++++++----- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 1d501e5f42..e2507095fe 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -45,7 +45,7 @@ jobs: - name: Generate Coverage Treemap run: | go install github.com/nikolaydubina/go-cover-treemap@latest - go-cover-treemap -h 240 -coverprofile coverage.out > coverage.svg + go-cover-treemap -h 240 -padding 0 -coverprofile coverage.out > coverage.svg - name: Run Stoat Action uses: stoat-dev/stoat-action@v0 if: always() diff --git a/.stoat/comment.hbs b/.stoat/comment.hbs index fcdb285e92..784bcedc4e 100644 --- a/.stoat/comment.hbs +++ b/.stoat/comment.hbs @@ -1,7 +1,23 @@ -{{#if plugins.json.linter.value.Issues.length}} -[![linter](https://img.shields.io/badge/linter-{{ plugins.json.linter.value.Issues.length }}%20issues-red.svg?style=flat)]({{ plugins.static_hosting.linter.link }}) -{{ else }} -[![linter](https://img.shields.io/badge/linter<{{ plugins.static_hosting.linter.sha }}>-passing-brightgreen.svg?style=flat)]({{ plugins.static_hosting.linter.link }}) -{{/if}} +### Build Results + + + + + + + + + +
Linter + + {{#if plugins.json.linter.value.Issues.length}} + {{ plugins.static_hosting.linter.sha }} failing + {{ else }} + {{ plugins.static_hosting.linter.sha }} passing + {{/if}} + +
TestsRow 2 Cell 2
+ +### Test Coverage [![test coverage]({{ plugins.static_hosting.coverage_image.link }})]({{ plugins.static_hosting.coverage_html.link }}) From 7c9c023e1f07f656600afe1546d7690b87879ecc Mon Sep 17 00:00:00 2001 From: jrhizor Date: Wed, 15 Feb 2023 16:25:01 -0800 Subject: [PATCH 06/25] clean up table --- .gitignore | 1 + .stoat/comment.hbs | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index a2bc75c421..8bc262a557 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ coverage.html golangci.html golangci.json bin +tests.log diff --git a/.stoat/comment.hbs b/.stoat/comment.hbs index 784bcedc4e..c0c0e9261e 100644 --- a/.stoat/comment.hbs +++ b/.stoat/comment.hbs @@ -3,19 +3,25 @@ + - + +
Linter + {{ plugins.static_hosting.linter.sha }} + {{#if plugins.json.linter.value.Issues.length}} - {{ plugins.static_hosting.linter.sha }} failing + {{ plugins.static_hosting.linter.sha }} failing {{ else }} - {{ plugins.static_hosting.linter.sha }} passing + {{ plugins.static_hosting.linter.sha }} passing {{/if}}
TestsRow 2 Cell 2 + {{ plugins.static_hosting.linter.sha }} + todo
From 1b51bc2262f9d074c8358c9c42369fad219e8831 Mon Sep 17 00:00:00 2001 From: jrhizor Date: Wed, 15 Feb 2023 16:26:03 -0800 Subject: [PATCH 07/25] fmt --- .stoat/comment.hbs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stoat/comment.hbs b/.stoat/comment.hbs index c0c0e9261e..c99a708515 100644 --- a/.stoat/comment.hbs +++ b/.stoat/comment.hbs @@ -2,7 +2,7 @@ - + @@ -17,7 +17,7 @@ - + From d0d7d1e2de5460e3632e02ad3697ed8578ca311e Mon Sep 17 00:00:00 2001 From: jrhizor Date: Wed, 15 Feb 2023 16:51:53 -0800 Subject: [PATCH 08/25] fix access --- .github/workflows/go.yaml | 18 ++++++++++++++++-- .gitignore | 5 ++++- .stoat/comment.hbs | 2 +- .stoat/config.yaml | 4 ++-- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index e2507095fe..873db2b22b 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -22,7 +22,14 @@ jobs: run: | curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.50.1 ./bin/golangci-lint run --verbose - + - name: Extract Issue Count + id: issues + uses: sergeysova/jq-action@v2 + with: + cmd: 'jq ".Issues | length" golangci.json -r' + - name: Write Issue Count + run: | + echo "{ "issues": ${{ steps.version.outputs.value }} }" > issues.json - name: Run Stoat Action uses: stoat-dev/stoat-action@v0 if: always() @@ -39,10 +46,17 @@ jobs: with: go-version: 1.18 - name: Test - run: go test -coverprofile coverage.out -race ./... + run: gotestsum --jsonfile tests.jsonl --junitfile junit.xml -- -race -coverprofile=coverage.out ./... + - name: Generate Test Result HTML + if: always() + run: | + go get -u github.com/vakenbolt/go-test-report/ + cat tests.jsonl | go-test-report -o tests.html - name: Generate Coverage HTML + if: always() run: go tool cover -o coverage.html -html=coverage.out - name: Generate Coverage Treemap + if: always() run: | go install github.com/nikolaydubina/go-cover-treemap@latest go-cover-treemap -h 240 -padding 0 -coverprofile coverage.out > coverage.svg diff --git a/.gitignore b/.gitignore index 8bc262a557..c9cd514c20 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,7 @@ coverage.html golangci.html golangci.json bin -tests.log +tests.jsonl +tests.html +issues.json +junit.xml diff --git a/.stoat/comment.hbs b/.stoat/comment.hbs index c99a708515..380f6fed7f 100644 --- a/.stoat/comment.hbs +++ b/.stoat/comment.hbs @@ -8,7 +8,7 @@ - + @@ -23,9 +21,7 @@ {{ plugins.static_hosting.ubuntu_test_html.sha }} {{ plugins.static_hosting.ubuntu_test_html.status }} - +
LinterGo Linter {{ plugins.static_hosting.linter.sha }}
TestsGo Tests {{ plugins.static_hosting.linter.sha }} - {{#if plugins.json.linter.value.Issues.length}} + {{#if plugins.json.issues.value.issues}} {{ plugins.static_hosting.linter.sha }} failing {{ else }} {{ plugins.static_hosting.linter.sha }} passing diff --git a/.stoat/config.yaml b/.stoat/config.yaml index 643e7495b4..4169690e2c 100644 --- a/.stoat/config.yaml +++ b/.stoat/config.yaml @@ -6,8 +6,8 @@ plugins: job_runtime: enabled: true json: - linter: - path: golangci.json + issues: + path: issues.json static_hosting: coverage_image: path: coverage.svg From 1aa33faddd789bcedaf5d4228f9b958b5d093fb7 Mon Sep 17 00:00:00 2001 From: jrhizor Date: Wed, 15 Feb 2023 16:57:49 -0800 Subject: [PATCH 09/25] output html test report --- .github/workflows/go.yaml | 13 ++++++++----- .gitignore | 1 + .stoat/config.yaml | 2 ++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 873db2b22b..881c0f3bcb 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -46,12 +46,15 @@ jobs: with: go-version: 1.18 - name: Test - run: gotestsum --jsonfile tests.jsonl --junitfile junit.xml -- -race -coverprofile=coverage.out ./... - - name: Generate Test Result HTML - if: always() run: | - go get -u github.com/vakenbolt/go-test-report/ - cat tests.jsonl | go-test-report -o tests.html + go install gotest.tools/gotestsum@latest + gotestsum --jsonfile tests.jsonl --junitfile junit.xml -- -race -coverprofile=coverage.out ./... + - name: Generate Test Report HTML + id: xunit-viewer + uses: AutoModality/action-xunit-viewer@v1 + with: + results: junit.xml + output: junit.html - name: Generate Coverage HTML if: always() run: go tool cover -o coverage.html -html=coverage.out diff --git a/.gitignore b/.gitignore index c9cd514c20..847a3f46e3 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ tests.jsonl tests.html issues.json junit.xml +junit.html diff --git a/.stoat/config.yaml b/.stoat/config.yaml index 4169690e2c..3ebbd3b2bc 100644 --- a/.stoat/config.yaml +++ b/.stoat/config.yaml @@ -13,5 +13,7 @@ plugins: path: coverage.svg coverage_html: path: coverage.html + test_html: + path: junit.html linter: path: golangci.html From d3922d35fc640c3d70f1e0a7eb580873069b6120 Mon Sep 17 00:00:00 2001 From: jrhizor Date: Wed, 15 Feb 2023 16:59:20 -0800 Subject: [PATCH 10/25] only run go build --- .github/workflows/e2e.yml | 8 ++++---- .github/workflows/examples.yml | 12 ++++++------ .github/workflows/release.yml | 8 ++++---- .stoat/comment.hbs | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 54335819b7..3cb0eb0062 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -1,9 +1,9 @@ name: E2E -on: - push: - branches: [main] - pull_request: +#on: +# push: +# branches: [main] +# pull_request: jobs: install: diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 99c859e5cd..2267642223 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -1,11 +1,11 @@ name: Trigger example changes -on: - push: - branches: - - main - paths: - - 'examples/**' +#on: +# push: +# branches: +# - main +# paths: +# - 'examples/**' jobs: deploy-website: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a8bdd771eb..e85afccc41 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,9 +1,9 @@ name: Release -on: - push: - tags: - - "v*" +#on: +# push: +# tags: +# - "v*" jobs: goreleaser: diff --git a/.stoat/comment.hbs b/.stoat/comment.hbs index 380f6fed7f..d63b3c7726 100644 --- a/.stoat/comment.hbs +++ b/.stoat/comment.hbs @@ -2,7 +2,7 @@ - + @@ -17,7 +17,7 @@ - + From 16d4590889c3eb1918491f997a9b9c261f41e3c6 Mon Sep 17 00:00:00 2001 From: jrhizor Date: Wed, 15 Feb 2023 17:15:23 -0800 Subject: [PATCH 11/25] try just ubuntu --- .github/workflows/go.yaml | 15 ++++++++------- .stoat/comment.hbs | 22 +++++++++++++--------- .stoat/config.yaml | 18 ++++++++++++------ 3 files changed, 33 insertions(+), 22 deletions(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 881c0f3bcb..b59035d7a8 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -10,7 +10,7 @@ jobs: name: lint strategy: matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 @@ -27,9 +27,10 @@ jobs: uses: sergeysova/jq-action@v2 with: cmd: 'jq ".Issues | length" golangci.json -r' - - name: Write Issue Count + - name: Write Issue Count & Copy FIle run: | - echo "{ "issues": ${{ steps.version.outputs.value }} }" > issues.json + echo "{ "issues": ${{ steps.version.outputs.value }} }" > ${{ matrix.os }}-issues.json + cp golangci.html ${{ matrix.os }}-golangci.html - name: Run Stoat Action uses: stoat-dev/stoat-action@v0 if: always() @@ -37,7 +38,7 @@ jobs: test: strategy: matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 @@ -48,16 +49,16 @@ jobs: - name: Test run: | go install gotest.tools/gotestsum@latest - gotestsum --jsonfile tests.jsonl --junitfile junit.xml -- -race -coverprofile=coverage.out ./... + gotestsum --junitfile junit.xml -- -race -coverprofile=coverage.out ./... - name: Generate Test Report HTML id: xunit-viewer uses: AutoModality/action-xunit-viewer@v1 with: results: junit.xml - output: junit.html + output: ${{ matrix.os }}-junit.html - name: Generate Coverage HTML if: always() - run: go tool cover -o coverage.html -html=coverage.out + run: go tool cover -o ${{ matrix.os }}-coverage.html -html=coverage.out - name: Generate Coverage Treemap if: always() run: | diff --git a/.stoat/comment.hbs b/.stoat/comment.hbs index d63b3c7726..40357d1315 100644 --- a/.stoat/comment.hbs +++ b/.stoat/comment.hbs @@ -4,24 +4,28 @@ - + + -
Go LinterLinter {{ plugins.static_hosting.linter.sha }}
Go TestsTests {{ plugins.static_hosting.linter.sha }}
Linter - {{ plugins.static_hosting.linter.sha }} - - - {{#if plugins.json.issues.value.issues}} - {{ plugins.static_hosting.linter.sha }} failing + + {{#if plugins.json.ubuntu_issues.value.issues}} + {{ plugins.static_hosting.ubuntu_linter.sha }} failing {{ else }} - {{ plugins.static_hosting.linter.sha }} passing + {{ plugins.static_hosting.ubuntu_linter.sha }} passing {{/if}} + {{ plugins.static_hosting.ubuntu_linter.sha }} +
Tests - {{ plugins.static_hosting.linter.sha }} + + {{ plugins.static_hosting.ubuntu_test_html.sha }} {{ plugins.static_hosting.ubuntu_test_html.status }} + + + {{ plugins.static_hosting.ubuntu_linter.sha }} todo
diff --git a/.stoat/config.yaml b/.stoat/config.yaml index 3ebbd3b2bc..85c8e43544 100644 --- a/.stoat/config.yaml +++ b/.stoat/config.yaml @@ -6,14 +6,20 @@ plugins: job_runtime: enabled: true json: - issues: - path: issues.json + ubuntu_issues: + path: ubuntu-latest-issues.json + windows_issues: + path: windows-latest-issues.json static_hosting: coverage_image: path: coverage.svg coverage_html: path: coverage.html - test_html: - path: junit.html - linter: - path: golangci.html + ubuntu_linter: + path: ubuntu-latest-golangci.html + windows_linter: + path: windows-latest-golangci.html + ubuntu_test_html: + path: ubuntu-latest-junit.html + windows_test_html: + path: windows-latest-junit.html From 3877f64778ffd0be65ef62a46668c60166703aa2 Mon Sep 17 00:00:00 2001 From: jrhizor Date: Wed, 15 Feb 2023 17:17:46 -0800 Subject: [PATCH 12/25] add runtime --- .stoat/comment.hbs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.stoat/comment.hbs b/.stoat/comment.hbs index 40357d1315..7de723ffa0 100644 --- a/.stoat/comment.hbs +++ b/.stoat/comment.hbs @@ -31,3 +31,5 @@ ### Test Coverage [![test coverage]({{ plugins.static_hosting.coverage_image.link }})]({{ plugins.static_hosting.coverage_html.link }}) + +{{{ views.plugins.job_runtime.github.chart }}} From 2c24fd92103841541fa0384852ff39a7364cdf68 Mon Sep 17 00:00:00 2001 From: jrhizor Date: Wed, 15 Feb 2023 17:19:19 -0800 Subject: [PATCH 13/25] always output issue count --- .github/workflows/go.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index b59035d7a8..6e97c91481 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -23,11 +23,13 @@ jobs: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.50.1 ./bin/golangci-lint run --verbose - name: Extract Issue Count + if: always() id: issues uses: sergeysova/jq-action@v2 with: cmd: 'jq ".Issues | length" golangci.json -r' - - name: Write Issue Count & Copy FIle + - name: Write Issue Count & Copy File + if: always() run: | echo "{ "issues": ${{ steps.version.outputs.value }} }" > ${{ matrix.os }}-issues.json cp golangci.html ${{ matrix.os }}-golangci.html From 7bf24a4ff3bc27e9a99b11f4bb96a384290a66d8 Mon Sep 17 00:00:00 2001 From: jrhizor Date: Wed, 15 Feb 2023 17:29:24 -0800 Subject: [PATCH 14/25] update --- .github/workflows/go.yaml | 4 ++-- .stoat/comment.hbs | 8 ++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 6e97c91481..dffa7c8b8c 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -31,7 +31,7 @@ jobs: - name: Write Issue Count & Copy File if: always() run: | - echo "{ "issues": ${{ steps.version.outputs.value }} }" > ${{ matrix.os }}-issues.json + echo '{ "issues": ${{ steps.version.outputs.value }} }' > ${{ matrix.os }}-issues.json cp golangci.html ${{ matrix.os }}-golangci.html - name: Run Stoat Action uses: stoat-dev/stoat-action@v0 @@ -60,7 +60,7 @@ jobs: output: ${{ matrix.os }}-junit.html - name: Generate Coverage HTML if: always() - run: go tool cover -o ${{ matrix.os }}-coverage.html -html=coverage.out + run: go tool cover -o coverage.html -html=coverage.out - name: Generate Coverage Treemap if: always() run: | diff --git a/.stoat/comment.hbs b/.stoat/comment.hbs index 7de723ffa0..a3dcccacf7 100644 --- a/.stoat/comment.hbs +++ b/.stoat/comment.hbs @@ -12,9 +12,7 @@ {{/if}}
- {{ plugins.static_hosting.ubuntu_linter.sha }} - {{ plugins.static_hosting.ubuntu_linter.sha }}
Tests - {{ plugins.static_hosting.ubuntu_linter.sha }} - {{ plugins.static_hosting.ubuntu_linter.sha }}
From 3ab85c4d233e8f38e2b5f5e447b7f7a914e299c6 Mon Sep 17 00:00:00 2001 From: jrhizor Date: Wed, 15 Feb 2023 17:31:42 -0800 Subject: [PATCH 15/25] update test result link format --- .stoat/comment.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stoat/comment.hbs b/.stoat/comment.hbs index a3dcccacf7..fb9d916f0e 100644 --- a/.stoat/comment.hbs +++ b/.stoat/comment.hbs @@ -18,7 +18,7 @@ Tests - {{ plugins.static_hosting.ubuntu_test_html.sha }} {{ plugins.static_hosting.ubuntu_test_html.status }} + {{ plugins.static_hosting.ubuntu_test_html.sha }} {{ plugins.static_hosting.ubuntu_test_html.status }} {{ plugins.static_hosting.ubuntu_linter.sha }} From 4ad330f12d53e4f647e15e67dc506d7ba1a05755 Mon Sep 17 00:00:00 2001 From: jrhizor Date: Wed, 15 Feb 2023 17:41:00 -0800 Subject: [PATCH 16/25] adjust styling and log file contents --- .github/workflows/go.yaml | 1 + .stoat/comment.hbs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index dffa7c8b8c..727354df9b 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -33,6 +33,7 @@ jobs: run: | echo '{ "issues": ${{ steps.version.outputs.value }} }' > ${{ matrix.os }}-issues.json cp golangci.html ${{ matrix.os }}-golangci.html + cat ${{ matrix.os }}-issues.json - name: Run Stoat Action uses: stoat-dev/stoat-action@v0 if: always() diff --git a/.stoat/comment.hbs b/.stoat/comment.hbs index fb9d916f0e..800d45735d 100644 --- a/.stoat/comment.hbs +++ b/.stoat/comment.hbs @@ -6,7 +6,7 @@ {{#if plugins.json.ubuntu_issues.value.issues}} - {{ plugins.static_hosting.ubuntu_linter.sha }} failing + {{ plugins.static_hosting.ubuntu_linter.sha }} failing {{ else }} {{ plugins.static_hosting.ubuntu_linter.sha }} passing {{/if}} @@ -18,7 +18,7 @@ Tests - {{ plugins.static_hosting.ubuntu_test_html.sha }} {{ plugins.static_hosting.ubuntu_test_html.status }} + {{ plugins.static_hosting.ubuntu_test_html.sha }} {{ plugins.static_hosting.ubuntu_test_html.status }} {{ plugins.static_hosting.ubuntu_linter.sha }} From 3b68defe7b2b2c06c91173218450110fad0c2b5e Mon Sep 17 00:00:00 2001 From: jrhizor Date: Wed, 15 Feb 2023 17:46:06 -0800 Subject: [PATCH 17/25] intentionally fail test so it shows failure caase --- tests/fns/event-trigger-expression/run.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fns/event-trigger-expression/run.go b/tests/fns/event-trigger-expression/run.go index b66900193d..def6636111 100644 --- a/tests/fns/event-trigger-expression/run.go +++ b/tests/fns/event-trigger-expression/run.go @@ -104,7 +104,7 @@ func Do(ctx context.Context) testdsl.Chain { testdsl.RequireLogFieldsWithin(map[string]any{ "caller": "runner", "function": "event-trigger-expression", - "message": "initializing fn", + "message": "initializing fn INTENTIONALLY FAIL", }, testdsl.DefaultDuration), } } From b118a217499196b424e57275c7fc3cfa05e23fd3 Mon Sep 17 00:00:00 2001 From: jrhizor Date: Wed, 15 Feb 2023 17:48:19 -0800 Subject: [PATCH 18/25] facepalm --- .github/workflows/go.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 727354df9b..806c3848d7 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -31,7 +31,7 @@ jobs: - name: Write Issue Count & Copy File if: always() run: | - echo '{ "issues": ${{ steps.version.outputs.value }} }' > ${{ matrix.os }}-issues.json + echo '{ "issues": ${{ steps.issues.outputs.value }} }' > ${{ matrix.os }}-issues.json cp golangci.html ${{ matrix.os }}-golangci.html cat ${{ matrix.os }}-issues.json - name: Run Stoat Action From f53aa129d1bdb998f004f0f3cbf54e1a3ee3903c Mon Sep 17 00:00:00 2001 From: jrhizor Date: Wed, 15 Feb 2023 17:53:19 -0800 Subject: [PATCH 19/25] use consistent badge styling --- .github/workflows/go.yaml | 5 ++++- .stoat/comment.hbs | 6 +++++- .stoat/config.yaml | 8 ++------ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 806c3848d7..bd65e5a2b5 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -33,7 +33,6 @@ jobs: run: | echo '{ "issues": ${{ steps.issues.outputs.value }} }' > ${{ matrix.os }}-issues.json cp golangci.html ${{ matrix.os }}-golangci.html - cat ${{ matrix.os }}-issues.json - name: Run Stoat Action uses: stoat-dev/stoat-action@v0 if: always() @@ -53,6 +52,10 @@ jobs: run: | go install gotest.tools/gotestsum@latest gotestsum --junitfile junit.xml -- -race -coverprofile=coverage.out ./... + - name: Write Test Status + if: always() + run: | + echo '{ "success": ${{ success() }} }' > ${{ matrix.os }}-status.json - name: Generate Test Report HTML id: xunit-viewer uses: AutoModality/action-xunit-viewer@v1 diff --git a/.stoat/comment.hbs b/.stoat/comment.hbs index 800d45735d..7b7a2ce120 100644 --- a/.stoat/comment.hbs +++ b/.stoat/comment.hbs @@ -18,7 +18,11 @@ Tests - {{ plugins.static_hosting.ubuntu_test_html.sha }} {{ plugins.static_hosting.ubuntu_test_html.status }} + {{#if plugins.json.status.value.success}} + {{ plugins.static_hosting.ubuntu_linter.sha }} passing + {{ else }} + {{ plugins.static_hosting.ubuntu_linter.sha }} failing + {{/if}} {{ plugins.static_hosting.ubuntu_linter.sha }} diff --git a/.stoat/config.yaml b/.stoat/config.yaml index 85c8e43544..4b64ceed02 100644 --- a/.stoat/config.yaml +++ b/.stoat/config.yaml @@ -8,8 +8,8 @@ plugins: json: ubuntu_issues: path: ubuntu-latest-issues.json - windows_issues: - path: windows-latest-issues.json + status: + path: ubuntu-latest-status.json static_hosting: coverage_image: path: coverage.svg @@ -17,9 +17,5 @@ plugins: path: coverage.html ubuntu_linter: path: ubuntu-latest-golangci.html - windows_linter: - path: windows-latest-golangci.html ubuntu_test_html: path: ubuntu-latest-junit.html - windows_test_html: - path: windows-latest-junit.html From 1ddbd17edd055ba7727434b6a4e76d44c777778c Mon Sep 17 00:00:00 2001 From: jrhizor Date: Wed, 15 Feb 2023 17:56:17 -0800 Subject: [PATCH 20/25] fix workflow --- .github/workflows/go.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index bd65e5a2b5..c7fe34460e 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -52,10 +52,14 @@ jobs: run: | go install gotest.tools/gotestsum@latest gotestsum --junitfile junit.xml -- -race -coverprofile=coverage.out ./... - - name: Write Test Status - if: always() + - name: Write Success + if: ${{ success() }} + run: | + echo '{ "success": true }' > ${{ matrix.os }}-status.json + - name: Write Failure + if: ${{ failure() }} run: | - echo '{ "success": ${{ success() }} }' > ${{ matrix.os }}-status.json + echo '{ "success": false }' > ${{ matrix.os }}-status.json - name: Generate Test Report HTML id: xunit-viewer uses: AutoModality/action-xunit-viewer@v1 From b717b9598351a3ccb76ed1a208f0e4450d6c36f6 Mon Sep 17 00:00:00 2001 From: jrhizor Date: Wed, 15 Feb 2023 18:17:46 -0800 Subject: [PATCH 21/25] fail test --- tests/fns/event-trigger-expression/run.go | 30 +++++++++++------------ 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/fns/event-trigger-expression/run.go b/tests/fns/event-trigger-expression/run.go index def6636111..0dfc9d1fd4 100644 --- a/tests/fns/event-trigger-expression/run.go +++ b/tests/fns/event-trigger-expression/run.go @@ -80,20 +80,20 @@ func Do(ctx context.Context) testdsl.Chain { // # Third test: success // // OK is false, cart items match. - testdsl.SendEvent(event.Event{ - Name: "test/trigger-expression", - Data: map[string]any{ - "ok": true, - "cart_items": []map[string]any{ - { - "price": 999, - }, - { - "price": 100, - }, - }, - }, - }), +// testdsl.SendEvent(event.Event{ +// Name: "test/trigger-expression", +// Data: map[string]any{ +// "ok": true, +// "cart_items": []map[string]any{ +// { +// "price": 999, +// }, +// { +// "price": 100, +// }, +// }, +// }, +// }), testdsl.RequireOutputWithin("received message", 500*time.Millisecond), // Ensure runner consumes event. testdsl.RequireLogFieldsWithin(map[string]any{ @@ -104,7 +104,7 @@ func Do(ctx context.Context) testdsl.Chain { testdsl.RequireLogFieldsWithin(map[string]any{ "caller": "runner", "function": "event-trigger-expression", - "message": "initializing fn INTENTIONALLY FAIL", + "message": "initializing fn", }, testdsl.DefaultDuration), } } From 28f971b7b30bc29d24c2bb3e7c3c391fe2e3d1bb Mon Sep 17 00:00:00 2001 From: jrhizor Date: Wed, 15 Feb 2023 18:32:06 -0800 Subject: [PATCH 22/25] fail actual assertion --- pkg/execution/state/redis_state/queue_test.go | 2 +- tests/fns/event-trigger-expression/run.go | 28 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/pkg/execution/state/redis_state/queue_test.go b/pkg/execution/state/redis_state/queue_test.go index d763efc5b2..b1fff77b40 100644 --- a/pkg/execution/state/redis_state/queue_test.go +++ b/pkg/execution/state/redis_state/queue_test.go @@ -64,7 +64,7 @@ func TestQueueEnqueueItem(t *testing.T) { require.Equal(t, QueuePartition{ WorkflowID: item.WorkflowID, Priority: testPriority, - AtS: start.Unix(), + AtS: start.Unix() + 1, }, qp) // Ensure that the zscore did not change. diff --git a/tests/fns/event-trigger-expression/run.go b/tests/fns/event-trigger-expression/run.go index 0dfc9d1fd4..b66900193d 100644 --- a/tests/fns/event-trigger-expression/run.go +++ b/tests/fns/event-trigger-expression/run.go @@ -80,20 +80,20 @@ func Do(ctx context.Context) testdsl.Chain { // # Third test: success // // OK is false, cart items match. -// testdsl.SendEvent(event.Event{ -// Name: "test/trigger-expression", -// Data: map[string]any{ -// "ok": true, -// "cart_items": []map[string]any{ -// { -// "price": 999, -// }, -// { -// "price": 100, -// }, -// }, -// }, -// }), + testdsl.SendEvent(event.Event{ + Name: "test/trigger-expression", + Data: map[string]any{ + "ok": true, + "cart_items": []map[string]any{ + { + "price": 999, + }, + { + "price": 100, + }, + }, + }, + }), testdsl.RequireOutputWithin("received message", 500*time.Millisecond), // Ensure runner consumes event. testdsl.RequireLogFieldsWithin(map[string]any{ From a26d5a8f5c302d8a725e0a733b56e10e6ae7df9f Mon Sep 17 00:00:00 2001 From: jrhizor Date: Wed, 15 Feb 2023 18:57:48 -0800 Subject: [PATCH 23/25] improve links --- .github/workflows/go.yaml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index c7fe34460e..c3a32e57af 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -60,12 +60,11 @@ jobs: if: ${{ failure() }} run: | echo '{ "success": false }' > ${{ matrix.os }}-status.json - - name: Generate Test Report HTML - id: xunit-viewer - uses: AutoModality/action-xunit-viewer@v1 + - uses: actions/setup-python@v4 with: - results: junit.xml - output: ${{ matrix.os }}-junit.html + python-version: '3.10' + - run: pip3 install junit2html + - run: junit2html junit.xml ${{ matrix.os }}-junit.html - name: Generate Coverage HTML if: always() run: go tool cover -o coverage.html -html=coverage.out From f00d87b04fda0c344866a94b1abc1025e1ed761c Mon Sep 17 00:00:00 2001 From: jrhizor Date: Wed, 15 Feb 2023 19:09:08 -0800 Subject: [PATCH 24/25] fix rendering for failure --- .github/workflows/go.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index c3a32e57af..7b8ee4f992 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -61,10 +61,13 @@ jobs: run: | echo '{ "success": false }' > ${{ matrix.os }}-status.json - uses: actions/setup-python@v4 + if: always() with: python-version: '3.10' - run: pip3 install junit2html + if: always() - run: junit2html junit.xml ${{ matrix.os }}-junit.html + if: always() - name: Generate Coverage HTML if: always() run: go tool cover -o coverage.html -html=coverage.out From f1a227a0c6bdb0fafad2dfcc15d2cc214c02a6c3 Mon Sep 17 00:00:00 2001 From: jrhizor Date: Wed, 15 Feb 2023 19:40:16 -0800 Subject: [PATCH 25/25] switch to using go-test-report --- .github/workflows/go.yaml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 7b8ee4f992..febd71eada 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -51,7 +51,7 @@ jobs: - name: Test run: | go install gotest.tools/gotestsum@latest - gotestsum --junitfile junit.xml -- -race -coverprofile=coverage.out ./... + gotestsum --jsonfile tests.jsonl -- -race -coverprofile=coverage.out ./... - name: Write Success if: ${{ success() }} run: | @@ -60,14 +60,11 @@ jobs: if: ${{ failure() }} run: | echo '{ "success": false }' > ${{ matrix.os }}-status.json - - uses: actions/setup-python@v4 - if: always() - with: - python-version: '3.10' - - run: pip3 install junit2html - if: always() - - run: junit2html junit.xml ${{ matrix.os }}-junit.html + - name: Generate Test HTML if: always() + run: | + go install github.com/vakenbolt/go-test-report@latest + cat tests.jsonl | go-test-report -o ${{ matrix.os }}-junit.html - name: Generate Coverage HTML if: always() run: go tool cover -o coverage.html -html=coverage.out