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

feat: move unit tests from Circleci to Github actions #25570

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from

Conversation

itsyoboieltr
Copy link
Contributor

@itsyoboieltr itsyoboieltr commented Jun 27, 2024

Description

Open in GitHub Codespaces

This PR moves unit tests from Circleci to Github actions. This is needed to pass the Jest export to SonarCloud in order finalize the SonarCloud integration. The reason why we want to use Github action rather than Circleci is because Sonarcloud integration happens in a Github action and we cannot pass data (i.e. the artifact) from Circleci to Github action.

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2449

Manual testing steps

  1. Seeing unit tests pass in GitHub actions instead of Circleci

Screenshots/Recordings

Not applicable

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

Copy link

codecov bot commented Jun 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.60%. Comparing base (c641981) to head (9711df5).
Report is 9 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #25570   +/-   ##
========================================
  Coverage    69.60%   69.60%           
========================================
  Files         1364     1364           
  Lines        48173    48173           
  Branches     13291    13291           
========================================
  Hits         33527    33527           
  Misses       14646    14646           

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

@metamaskbot
Copy link
Collaborator

Builds ready [a399875]
Page Load Metrics (46 ± 3 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint66978084
domContentLoaded8171021
load38644673
domInteractive8171021
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [ce18831]
Page Load Metrics (225 ± 246 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint7111489126
domContentLoaded9361263
load431778225512246
domInteractive9361263
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@itsyoboieltr itsyoboieltr marked this pull request as ready for review July 1, 2024 16:00
@itsyoboieltr itsyoboieltr requested review from kumavis and a team as code owners July 1, 2024 16:00
Copy link

sonarcloud bot commented Jul 2, 2024

@metamaskbot
Copy link
Collaborator

Builds ready [9711df5]
Page Load Metrics (70 ± 11 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint691451002110
domContentLoaded95625136
load43118702211
domInteractive95625136
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link
Contributor

@davidmurdoch davidmurdoch left a comment

Choose a reason for hiding this comment

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

just a partial review with some questions before I look more closely.

@@ -1462,7 +1449,7 @@ jobs:
fi
no_output_timeout: 5m
environment:
ENABLE_CONFIRMATION_REDESIGN: "true"
Copy link
Contributor

Choose a reason for hiding this comment

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

leave these drive-by changes out so we can git blame more usefully in the future.

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
Copy link
Contributor

Choose a reason for hiding this comment

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

we probably need to pin the version, as not doing so will result in non-deterministic tests.

Comment on lines +11 to +25
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'

- run: corepack enable

- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: yarn
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need two steps to set up Node?

Comment on lines +41 to +58
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'

- run: corepack enable

- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: yarn

- name: Install dependencies
run: yarn --immutable
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way to make these steps, or at least some of them (especially the yarn --immutable step), part of the same workflow so we don't have to repeat work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs dev review
Development

Successfully merging this pull request may close these issues.

None yet

3 participants