Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json reports #266

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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' \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

location should be the moonscope variable.
also it is missing the token part

--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"]
}