Skip to content
This repository has been archived by the owner on Mar 9, 2024. It is now read-only.

Commit

Permalink
Try code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
rmanaem committed Dec 18, 2023
1 parent 81a690f commit 4fb9ee4
Show file tree
Hide file tree
Showing 8 changed files with 1,872 additions and 7 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js environment
uses: actions/setup-node@v4.0.0
with:
node-version: 16
- name: Create .env file
run: |
echo -e "API_QUERY_URL=${{ vars.API_QUERY_URL }}\nIS_FEDERATION_API=${{ vars.IS_FEDERATION_API }}" > .env
- name: Install Dependencies
run: npm install
- name: Build the project
run: npm run build
- name: Run E2E and Component tests with coverage
run: npm run test:all
- name: Collect Coverage
run: npx nyc report --reporter=json
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage/*.json
flags: e2e,component
fail_ci_if_error: true
verbose: true
3 changes: 3 additions & 0 deletions cypress/downloads/dataset-level-results.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DatasetID DatasetName PortalURI NumMatchingSubjects AvailableImageModalities
https://someportal.org/datasets/ds0001 some name 3 http://purl.org/nidash/nidm#FlowWeighted, http://purl.org/nidash/nidm#T1Weighted
https://someportal.org/datasets/ds0002 some coolname 5 http://purl.org/nidash/nidm#FlowWeighted, http://purl.org/nidash/nidm#T1Weighted
3 changes: 3 additions & 0 deletions cypress/downloads/participant-level-results.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DatasetID SubjectID Age Sex Diagnosis Assessment SessionID SessionPath NumSessions Modality
https://someportal.org/datasets/ds0001 protected protected protected protected protected protected protected protected protected
https://someportal.org/datasets/ds0002 sub-04 35.0 http://purl.bioontology.org/ontology/SNOMEDCT/248153007 , , ses-nb04 /ds000011/sub-04 1 http://purl.org/nidash/nidm#T2Weighted, http://purl.org/nidash/nidm#T1Weighted, http://purl.org/nidash/nidm#FlowWeighted
5 changes: 5 additions & 0 deletions cypress/plugins/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* eslint-disable global-require */
module.exports = (on, config) => {
require('@cypress/code-coverage/task')(on, config);
return config;
};
1 change: 1 addition & 0 deletions cypress/support/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import '@cypress/code-coverage/support';
6 changes: 6 additions & 0 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ export default {
buildModules: [
// https://go.nuxtjs.dev/eslint
'@nuxtjs/eslint-module',
'@nuxtjs/istanbul',
],
istanbul: {
// Only enable coverage for development to avoid impact on production build
// You can use environment variables to control this behavior as needed
enabled: true,
},

// Modules: https://go.nuxtjs.dev/config-modules
modules: [
Expand Down
Loading

0 comments on commit 4fb9ee4

Please sign in to comment.