Skip to content
This repository was archived by the owner on Apr 19, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 1 commit
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
35 changes: 0 additions & 35 deletions .github/workflows/npm-test.yml

This file was deleted.

65 changes: 65 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
name: tests

on:
pull_request:
push:
workflow_dispatch:
inputs:
Copy link
Contributor

Choose a reason for hiding this comment

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

It throws an error here for empty lines!
Maybe this should be removed! 😄

Copy link
Author

Choose a reason for hiding this comment

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

Good point, removed, update all pending workflows

concurrency:
group: dashboard-${{ github.ref }}
cancel-in-progress: true

jobs:
tests:
name: Run Tests
runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: "12.22.0"
Copy link

@dimko dimko Mar 1, 2022

Choose a reason for hiding this comment

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

@netdata/cloud-fe should the version be that one? It's the same for every other test coverage PR, but previously it was set to node-version: '12.x'

cache: "npm"
- name: Install dependencies
run: npm install

- name: Run Tests
if: github.event_name != 'pull_request'
continue-on-error: true
id: run-tests
run: npm test -- --coverage --watchAll=false > /tmp/coverage_report

- name: Post Test Coverage Report in PR
uses: ArtiomTr/jest-coverage-report-action@v2
continue-on-error: true
if: github.event_name == 'pull_request'
with:
test-script: npm run test
annotations: all

- name: Gain access to test-reports bucket
if: (steps.run-tests.outcome == 'failure' || steps.run-tests.outcome == 'success') && github.ref == 'refs/heads/develop'
uses: google-github-actions/setup-gcloud@master
with:
project_id: "netdata-cloud-testing"
service_account_key: ${{ secrets.TEST_AUTOMATION_SERVICE_ACCOUNT }}
export_default_credentials: true

- name: Upload report to test-reports bucket
if: (steps.run-tests.outcome == 'failure' || steps.run-tests.outcome == 'success') && github.ref == 'refs/heads/develop'
run: |
gsutil -h "Cache-Control: max-age=0, no-store" cp /tmp/coverage_report gs://${{ secrets.TEST_AUTOMATION_STORAGE_BUCKET }}/${{ github.event.repository.name }}/coverage_report
Copy link
Contributor

Choose a reason for hiding this comment

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

Also the checks throw an error here for too line size!

Copy link
Author

Choose a reason for hiding this comment

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

Updated in all pending workflows

gsutil acl set project-private gs://${{ secrets.TEST_AUTOMATION_STORAGE_BUCKET }}/${{ github.event.repository.name }}/coverage_report
- name: Publish test coverage report
if: (steps.run-tests.outcome == 'failure' || steps.run-tests.outcome == 'success') && github.ref == 'refs/heads/develop'
uses: aurelien-baudet/workflow-dispatch@v2
with:
repo: netdata/cloud-workflows
ref: refs/heads/main
workflow: test_coverage_publisher.yml
token: ${{ secrets.TEST_AUTOMATION_TOKEN }}
inputs: '{ "service-name": "${{ github.event.repository.name }}"}'
16 changes: 3 additions & 13 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@
"inlineSources": true,
"sourceRoot": "/",
"noImplicitAny": false,
"lib": [
"esnext",
"dom",
"dom.iterable"
],
"lib": ["esnext", "dom", "dom.iterable"],
"module": "esnext",
"target": "es2018",
"jsx": "react",
Expand All @@ -28,12 +24,6 @@
"noEmit": true,
"declaration": true
},
"include": [
"./src/**/*"
],
"exclude": [
"/node_modules/",
"**/*.test.ts",
"**/*.test.tsx"
]
"include": ["./src/**/*", "src/vendor/dygraph-c91c859.min.js"],
Copy link

Choose a reason for hiding this comment

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

I don't see this dygraph js included in the previous version of the tsconfig.json, what is the reason for this being added now?

"exclude": ["/node_modules/", "**/*.test.ts", "**/*.test.tsx"]
}