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

ci(workflows): Add code coverage reporting for v2 #6884

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

AnuthaDev
Copy link
Contributor

@AnuthaDev AnuthaDev commented Dec 19, 2024

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Added a CI pipeline that will run cypress tests and generate code coverage reports for v2

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

Closes #1593
Closes #1587
Closes #1622
Closes #1700

How did you test it?

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

Copy link

semanticdiff-com bot commented Dec 19, 2024

Review changes with  SemanticDiff

Changed Files
File Status
  cypress-tests-v2/package-lock.json  30% smaller
  .github/workflows/cypress-tests-runner.yml Unsupported file format
  docs/CONTRIBUTING.md Unsupported file format
  justfile Unsupported file format
  scripts/execute_cypress_v2.sh Unsupported file format

.github/workflows/cypress-tests-runner.yml Outdated Show resolved Hide resolved
.github/workflows/cypress-tests-runner.yml Outdated Show resolved Hide resolved
.github/workflows/cypress-tests-runner.yml Outdated Show resolved Hide resolved
.github/workflows/cypress-tests-runner.yml Outdated Show resolved Hide resolved
.github/workflows/cypress-tests-runner.yml Outdated Show resolved Hide resolved
Copy link

codecov bot commented Dec 19, 2024

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@AnuthaDev AnuthaDev force-pushed the code-vyapti branch 4 times, most recently from a64b93c to d2a1842 Compare December 26, 2024 16:05
@AnuthaDev AnuthaDev marked this pull request as ready for review December 26, 2024 16:09
@AnuthaDev AnuthaDev requested review from a team as code owners December 26, 2024 16:09
@AnuthaDev AnuthaDev self-assigned this Dec 26, 2024
@AnuthaDev AnuthaDev added A-CI-CD Area: Continuous Integration/Deployment api-v2 labels Dec 26, 2024
@AnuthaDev AnuthaDev added this to the December 2024 Release milestone Dec 26, 2024
CONNECTOR_AUTH_PASSPHRASE: ${{ secrets.CONNECTOR_AUTH_PASSPHRASE }}
CONNECTOR_CREDS_S3_BUCKET_URI: ${{ secrets.CONNECTOR_CREDS_S3_BUCKET_URI}}
DESTINATION_FILE_NAME: "creds.json.gpg"
S3_SOURCE_FILE_NAME: "6f8289a9-6da0-433b-8a24-18d4d7257b7f.json.gpg"
Copy link
Member

Choose a reason for hiding this comment

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

latest creds:

Suggested change
S3_SOURCE_FILE_NAME: "6f8289a9-6da0-433b-8a24-18d4d7257b7f.json.gpg"
S3_SOURCE_FILE_NAME: "aa328308-b34e-41b7-a590-4fe45cfe7991.json.gpg"

Comment on lines +163 to +166
if [[ "$(basename "$PWD")" != "cypress-tests-v2" ]]; then
print_color "yellow" "Changing directory to 'cypress-tests-v2'..."
cd cypress-tests-v2 || {
print_color "red" "ERROR: Directory 'cypress-tests-v2' not found!"
Copy link
Member

Choose a reason for hiding this comment

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

the only thing that is different here is this part of code when compared to execute_cypress.sh.

i feel, it is better to pass the directory name as an argument from ci (while keeping cypress-tests as default) to execute_cypress.sh instead of having this file.

Copy link
Member

Choose a reason for hiding this comment

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

If everything else in the script remains same, then sure, we can have the directory accepted as a command line arg.

Copy link
Member

Choose a reason for hiding this comment

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

i did verify. the difference that exist in the entire file is this section of code.

uses: dtolnay/rust-toolchain@master
with:
toolchain: stable 2 weeks ago
components: clippy llvm-tools-preview
Copy link
Member

Choose a reason for hiding this comment

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

We don't need clippy for this job, right?


- name: Install grcov
if: ${{ env.RUN_TESTS == 'true' }}
uses: baptiste0928/[email protected]
Copy link
Member

Choose a reason for hiding this comment

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

Use taiki-e/install-action instead.

@@ -20,6 +20,7 @@ env:
RUN_TESTS: ${{ ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name)) || (github.event_name == 'merge_group')}}
DEBUG: cypress:cli
RUST_MIN_STACK: 10485760
CODECOV_FILE: "lcov.info"
Copy link
Member

Choose a reason for hiding this comment

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

You can consider setting the environment variable on a per-job basis, for only the job that runs Cypress tests on v2 code.


For generating code coverage, follow the following steps:

- Make sure `grcov` and `llvm-tools-preview` are installed
Copy link
Member

Choose a reason for hiding this comment

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

How are these tools to be installed? Cargo, system package manager, etc.?

Can include cargo / rustup commands if the tools are to be installed with cargo / rustup.

cargo build --package router --bin router --no-default-features --features "${FEATURES}" {{ FLAGS }}
set +x

alias bb := build_v2
Copy link
Member

@SanchithHegde SanchithHegde Dec 27, 2024

Choose a reason for hiding this comment

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

We haven't kept any aliases for the v2 related recipes so far...

Not sure what format we should follow for v2 recipes.

Comment on lines +163 to +166
if [[ "$(basename "$PWD")" != "cypress-tests-v2" ]]; then
print_color "yellow" "Changing directory to 'cypress-tests-v2'..."
cd cypress-tests-v2 || {
print_color "red" "ERROR: Directory 'cypress-tests-v2' not found!"
Copy link
Member

Choose a reason for hiding this comment

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

If everything else in the script remains same, then sure, we can have the directory accepted as a command line arg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CI-CD Area: Continuous Integration/Deployment api-v2
Projects
None yet
4 participants