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

Address GitHub CI issues #5465

Merged
merged 10 commits into from
Nov 13, 2024
Merged

Conversation

gilluminate
Copy link
Contributor

@gilluminate gilluminate commented Nov 5, 2024

Cypress tests are inconsistent, randomly fail, are quite slow. To help address this, lets:

  • Upgrade older versions of Cypress and Turbo
  • Upgrade cypress-io/github-action to v6
  • Update lots of Cypress stubs to avoid ECONNREFUSED errors with no BE running (/api/v1/system/, /health, etc)
  • Fix error handling on Privacy Center to avoid crashes during fides-js tests with no BE running
  • Minimize run time by avoiding redundant builds

Copy link

vercel bot commented Nov 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fides-plus-nightly ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 13, 2024 9:42pm

Copy link

cypress bot commented Nov 5, 2024

fides    Run #10989

Run Properties:  status check passed Passed #10989  •  git commit 87bc0b7332 ℹ️: Merge 8617dfcc9745530125636d458b91b32ebff739d5 into aa9155af32f1885f831006010eee...
Project fides
Branch Review refs/pull/5465/merge
Run status status check passed Passed #10989
Run duration 00m 37s
Commit git commit 87bc0b7332 ℹ️: Merge 8617dfcc9745530125636d458b91b32ebff739d5 into aa9155af32f1885f831006010eee...
Committer Jason Gill
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 4
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.
View all changes introduced in this branch ↗︎

Copy link

codecov bot commented Nov 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.47%. Comparing base (44054e7) to head (70911eb).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5465   +/-   ##
=======================================
  Coverage   85.47%   85.47%           
=======================================
  Files         384      384           
  Lines       24119    24119           
  Branches     2625     2625           
=======================================
  Hits        20615    20615           
  Misses       2950     2950           
  Partials      554      554           

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

@gilluminate gilluminate force-pushed the gill/HJ-150/address-git-hub-ci-issues branch 2 times, most recently from 335cebe to 6af41f1 Compare November 8, 2024 00:07
@gilluminate gilluminate force-pushed the gill/HJ-150/address-git-hub-ci-issues branch from 6af41f1 to ee68312 Compare November 8, 2024 00:13
@gilluminate gilluminate marked this pull request as ready for review November 9, 2024 00:04
Copy link
Contributor

@lucanovera lucanovera left a comment

Choose a reason for hiding this comment

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

Great work Jason! We can now get into the habit of making tests that are fully autonomous. I have ran every test without the backend running and they're all passing.
I left a question about a change I don't understand.

},
).as("postGenerate");
cy.intercept("POST", "/api/v1/generate", {
delay: 1000,
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice cleanup

@@ -79,7 +81,7 @@ describe("Data map report table", () => {

it("can render empty datamap report", () => {
cy.intercept("GET", "/api/v1/plus/datamap/minimal*", {
body: { items: [], page: 1, pages: 0, size: 25, total: 0 },
fixture: "empty-pagination.json",
Copy link
Contributor

Choose a reason for hiding this comment

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

very reusable

fixture: "privacy-experiences/experienceConfig.json",
}).as("getExperienceDetail");
stubPlus(true);
stubProperties();
Copy link
Contributor

Choose a reason for hiding this comment

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

We had so many missing stubs, thanks for taking care of this.

if (!response.ok) {
let response: Response;

try {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice improvement on error handleling

transformResponse: (
response: CustomFieldDefinitionWithId[] | { detail: string },
) => {
if ("detail" in response) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't get the context for this change. Could you explain?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a great question that I'm trying to investigate and remember...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lucanovera I updated this code with a comment to explain why. For some reason, instead of an error code or an empty list, the BE is returning { detail: "No custom metadata fields found with resource type system" } which was causing a console error in this original piece of code.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the research! It's definitely a weird response by the BE, not a pattern we usually follow. I've created a tech debt ticket for it (https://ethyca.atlassian.net/browse/LA-142). After that is done, we won't need this custom handling. But for now, this is great.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea! Thanks for doing that.

Copy link
Contributor

@lucanovera lucanovera left a comment

Choose a reason for hiding this comment

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

Great work! All questions cleared, all tests passing. Approved!

Copy link
Contributor

@jpople jpople left a comment

Choose a reason for hiding this comment

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

Everything is passing for me-- great job cleaning all this up.

body: { access_result_urls: ["https://example.com/"] },
}).as("getAccessResultURL");
cy.wait("@getPrivacyRequest");
stubPrivacyRequests(PrivacyRequestStatus.COMPLETE);
// cy.wait("@getPrivacyRequest");
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be removed?

Copy link
Contributor

@jpople jpople left a comment

Choose a reason for hiding this comment

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

Looks good and passing all tests for me.

@gilluminate gilluminate merged commit d14d031 into main Nov 13, 2024
10 of 11 checks passed
@gilluminate gilluminate deleted the gill/HJ-150/address-git-hub-ci-issues branch November 13, 2024 21:39
Copy link

cypress bot commented Nov 13, 2024

fides    Run #10990

Run Properties:  status check passed Passed #10990  •  git commit d14d031e3d: Address GitHub CI issues (#5465)
Project fides
Branch Review main
Run status status check passed Passed #10990
Run duration 00m 38s
Commit git commit d14d031e3d: Address GitHub CI issues (#5465)
Committer Jason Gill
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 4
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.
View all changes introduced in this branch ↗︎

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