Skip to content

Added a Github Action to automate running tests as part of the CI workflow#2

Merged
xingzhang-suse merged 1 commit intoneuvector:mainfrom
lsongsuse:main
May 22, 2025
Merged

Added a Github Action to automate running tests as part of the CI workflow#2
xingzhang-suse merged 1 commit intoneuvector:mainfrom
lsongsuse:main

Conversation

@lsongsuse
Copy link
Contributor

No description provided.

Copy link
Contributor

@xingzhang-suse xingzhang-suse left a comment

Choose a reason for hiding this comment

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

This PR is for integrating CI test into github actions, but the codecov is still pending, right?

package.json Outdated
"@rancher/components": "^0.3.0-alpha.1",
"@rancher/shell": "^3.0.4",
"vue": "^3.5.13",
"vue": "^3.2.13",
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you clarify the reason to downgrade Vue's version?

Copy link
Contributor Author

@lsongsuse lsongsuse May 22, 2025

Choose a reason for hiding this comment

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

The "@rancher/components": "^0.3.0-alpha.1" supports up to Vue v3.2.13.

package.json Outdated
"serve-pkgs": "./node_modules/@rancher/shell/scripts/serve-pkgs",
"publish-pkgs": "./node_modules/@rancher/shell/scripts/extension/publish",
"parse-tag-name": "./node_modules/@rancher/shell/scripts/extension/parse-tag-name",
"test": "jest --config=jest.config.ts",
Copy link
Contributor

Choose a reason for hiding this comment

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

You can replace "test:ci"

@lsongsuse
Copy link
Contributor Author

This PR is for integrating CI test into github actions, but the codecov is still pending, right?

CodeCov is included.

Screenshot 2025-05-22 at 9 01 27 AM

@lsongsuse lsongsuse force-pushed the main branch 2 times, most recently from c300ac7 to 8f80d27 Compare May 22, 2025 16:39
Copy link

@holyspectral holyspectral left a comment

Choose a reason for hiding this comment

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

Generally looks good to me. For codecov to work you'd need to get its token setup. We can discuss this offline.

Comment on lines +1 to +20
name: Workflow for security-ui-exts
on: [push, pull_request]
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Node 20
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install dependencies
run: yarn install
- name: Run tests and collect coverage
run: npm run test:ci
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }} No newline at end of file

Choose a reason for hiding this comment

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

I'd recommend renaming it as ci.yml. This will sync with other projects and we can add other steps later, e.g., linter.

I saw -> Token of length 0 detected in your log. Have you added CODECOV_TOKEN secret to neuvector/security-ui-exts repo?

@holyspectral
Copy link

I've added the token. The change in this PR works well in this test PR and this run

@codecov
Copy link

codecov bot commented May 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@2e450d9). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff            @@
##             main        #2   +/-   ##
========================================
  Coverage        ?   100.00%           
========================================
  Files           ?         1           
  Lines           ?        31           
  Branches        ?         0           
========================================
  Hits            ?        31           
  Misses          ?         0           
  Partials        ?         0           
Flag Coverage Δ
unit-tests 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lsongsuse lsongsuse force-pushed the main branch 2 times, most recently from ddf79f7 to d4bd1cd Compare May 22, 2025 19:44
Copy link

@holyspectral holyspectral left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@xingzhang-suse xingzhang-suse left a comment

Choose a reason for hiding this comment

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

LGTM

@xingzhang-suse xingzhang-suse merged commit 1dc421c into neuvector:main May 22, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants