Skip to content

Commit

Permalink
json reports
Browse files Browse the repository at this point in the history
  • Loading branch information
timbrinded committed Sep 19, 2023
1 parent 4973189 commit 94e4758
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .changeset/happy-cars-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@moonwall/tests": patch
"@moonwall/docs": patch
"@moonwall/cli": patch
"@moonwall/types": patch
"@moonwall/util": patch
---

JSON reporting options
10 changes: 10 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,16 @@ jobs:
cd test
bun moonwall test chopsticks
# disabled until we have an available instance of moonscope running
# - name: Use Send Report Action
# if: always()
# uses: ./.github/send-report-action
# with:
# table: dev_reports
# moonwallenv: moonwall_chopsticks
# report_file_path: tmp/testReports.json
# moonscope: "https://moonscope.boo:3345"

test_readonly:
runs-on: ubuntu-latest
needs: ["build"]
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/send-report-action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# send-report-action/action.yml

name: 'Send Report Action'
description: 'Send a report using a REST call'
inputs:
moonscope:
description: 'Connection string of the moonscope server'
# e.g. https://moonscope.boo:3002
required: true
table:
description: 'Table name'
required: true
moonwallenv:
description: 'Moonwall Environment'
required: true
report_file_path:
description: 'Path to the report file'
required: true
default: 'tmp/testReports.json'
runs:
using: "composite"
steps:
- name: Read report file
id: read_file
run: echo "::set-output name=data::$(cat ${{ inputs.report_file_path }})"
shell: bash

- name: Send REST Call
run: |
curl --location '${{ inputs.report_file_path }}/insert' \
--header 'moonwallenv: ${{ inputs.moonwallenv }}' \
--header 'table: ${{ inputs.table }}' \
--header 'Content-Type: application/json' \
--data '${{ steps.read_file.outputs.data }}'
shell: bash
4 changes: 3 additions & 1 deletion test/moonwall.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@
"name": "chopsticks",
"testFileDir": ["suites/chopsticks/"],
"include": ["**/*basic*"],
"reporters": ["default", "json"],
"reportFile": { "json": "tmp/testResults.json" },
"foundation": {
"type": "chopsticks",
"rtUpgradePath": "./tmp/moonriver_runtime.compact.compressed.wasm",
Expand Down Expand Up @@ -535,7 +537,7 @@
"testFileDir": ["suites/dev_tests"],
"envVars": ["DEBUG_COLORS=1", "TIMBO_TEST_ENV='TIMBO timbo timbo'"],
"reporters": ["default", "html", "json"],
"reportFile": { "json": "tmp/report444.json" },
"reportFile": { "json": "tmp/testResults.json" },
"contracts": "contracts/",
"runScripts": ["compile-contracts.ts compile -p contracts/precompiles"],
"defaultSigner": {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
"noUncheckedIndexedAccess": true,
"strict": false //renable this oneday
},
"exclude": ["test/**", "**/dist/**", "./packages/*/*.d.ts", "./packages/*/*.d.cts"]
"exclude": ["**/dist/**", "./packages/*/*.d.ts", "./packages/*/*.d.cts", "node_modules"]
}

0 comments on commit 94e4758

Please sign in to comment.