This app provides a Tests Dashboard that helps track the test results overtime.
populated on clicking the graph bar
This is developed using golang/tinygo/nuxtjs/Spin
and deployed on Fermyon Cloud. It makes use of Fermyon's NoOps SQLite integration to store the results.
- Go JSON
- Rust JSON
- JUnit
Prerequisites:
- Ensure Spin is installed
- Refer to guide here for getting started with
Spin
andGo
(I usedgo 1.20
andtinygo 0.28.0
for developing this app) - Install npm/yarn
## clone the repo
git clone git@github.com:rajatjindal/tests-dashboard.git
cd tests-dashboard
## run npm install
cd ui
npm install
## go back to parent dir
cd ..
## build the app
spin build
spin up
## bootstrapping the schema when running locally
## connect to sqlite db in a new terminal
## and run the create table statements from backend/sql/create-table.sql
sqlite3 .spin/sqlite_db.db
### Inject some sample test results
curl -vXPOST http://localhost:3000/api/run/unique-run-id \
-H "Content-Type: multipart/mixed" \
-F "results=@backend/pkg/parser/junit/data/junit.log" \
-F "metadata={\"runId\":\"unique-run-id\",\"repo\":\"rajatjindal/tests-dashboard\",\"branch\":\"main\",\"format\":\"junit\", \"link\":\"http://link/to/github/actions/or/elsewhere\", \"tags\":\"tag1,tag2\"};type=application/json"
### open browser and navigate to http://localhost:3000/?service=rajatjindal/tests-dashboard
if you prefer to run on Fermyon Cloud (like me), follow following:
- Login to Fermyon Cloud
- Access to private beta for NoOps SQL. (only required if you wish to deploy to Fermyon Cloud)
- Create a Personal Access token and add it as a GitHub actions secret (with key
FERMYON_CLOUD_TOKEN
)
##-------------------------------
## deploy on Fermyon Cloud
##-------------------------------
spin deploy
## bootstrapping the schema on Fermyon Cloud
## open a new terminal and run following
## find the cloud database name
spin cloud sqlite list
## Init the schema
spin cloud sqlite execute <db-name> "$(cat backend/sql/create-table.sql)"
### Inject some sample test results
curl -vXPOST https://tests-dashboard-xxxxxxx.fermyon.app/api/run/unique-run-id \
-H "Content-Type: multipart/mixed" \
-F "results=@backend/pkg/parser/junit/data/junit.log" \
-F "metadata={\"runId\":\"unique-run-id\",\"repo\":\"rajatjindal/tests-dashboard\",\"branch\":\"main\",\"format\":\"junit\", \"link\":\"http://link/to/github/actions/or/elsewhere\", \"tags\":\"tag1,tag2\"};type=application/json"
### open browser and navigate to https://tests-dashboard-xxxxxxx.fermyon.app?service=rajatjindal/tests-dashboard
- Add authn/authz
- Allow pushing results for multiple services/tenants safe