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

chore(PPDSC-2611): fewer tests for baseline updates #588

Merged
merged 9 commits into from
Jan 30, 2023

Conversation

mstuartf
Copy link
Contributor

@mstuartf mstuartf commented Jan 25, 2023

PPDSC-2611

What

  1. Background - why this is needed
  • All tests are run to update baselines on main if any updates are required
  • This eats into our allowance unnecessarily
  1. What did you do
  • Use Percy API to track get a list of baselines that need updating
  • Export to a JSON file that is imported into the percy config under the include setting
  • Run tests in partial mode when updating baselines
  1. What does the reviewers should expect
  • Only tests whose baseline require updating should run

I have done:

  • Written unit tests against changes
  • Written functional tests against the component and/or NewsKit site
  • Updated relevant documentation

I have tested manually:

  • The feature's functionality is working as expected on Chrome, Firefox, Safari and Edge
  • The screen reader reads and flows through the elements as expected.
  • There are no new errors in the browser console coming from this PR.
  • When visual test is not added, it renders correctly on different browsers and mobile viewports (Safari, Firefox, small mobile viewport, tablet)
  • The Playground feature is working as expected

Before:

After:

Who should review this PR:

How to test:

@mstuartf mstuartf added the draft This is a draft PR and not intended for formal review yet label Jan 25, 2023
@mstuartf mstuartf requested a review from a team as a code owner January 25, 2023 18:14
@mstuartf mstuartf changed the title Chore/ppdsc 2611 example chore(PPDSC-2611): fewer tests for baseline updates Jan 25, 2023
@mstuartf mstuartf added ready for review Please assist in getting this reviewed and removed draft This is a draft PR and not intended for formal review yet labels Jan 25, 2023
@pp-serviceaccount
Copy link
Collaborator

mutebg
mutebg previously approved these changes Jan 26, 2023
Copy link
Contributor

@Xin00163 Xin00163 left a comment

Choose a reason for hiding this comment

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

Nice! Tests are especially helpful.

percy.config.js Show resolved Hide resolved
scripts/__tests__/check-baseline-updates.test.js Outdated Show resolved Hide resolved
const data = url.includes('/api/v1/builds') ? BUILDS : SNAPSHOTS;
streamStream.emit('data', JSON.stringify(data));
streamStream.emit('end');
};
Copy link
Contributor

Choose a reason for hiding this comment

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

This is nice. I've only seen people using a npm packages. Didn't know this simple but effective solution

echo "Baseline updates required; continuing job."
}
export PR_BRANCH_NAME=$(gh pr list --search $CIRCLE_SHA1 --state merged --json headRefName --jq '.[].headRefName')
echo "Found branch name: ${PR_BRANCH_NAME}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is is worth adding a comment so that people know this env variable name
PERCY_${project.toUpperCase()}_TOKEN is linked to the comps passed here?

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 point, perhaps it's not that clear. Looking at it, I think we should just set the PERCY_TOKEN value here and the script should assume that this is already set (I can comment that this is the case). The only reason the comps arg is passed is for setting the token.

What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Implemented

mutebg
mutebg previously approved these changes Jan 27, 2023
Xin00163
Xin00163 previously approved these changes Jan 27, 2023
@mstuartf mstuartf dismissed stale reviews from Xin00163 and mutebg via ecdf915 January 30, 2023 09:44
@mstuartf mstuartf merged commit fd4d458 into main Jan 30, 2023
@mstuartf mstuartf deleted the chore/PPDSC-2611-example branch January 30, 2023 15:16
mstuartf added a commit that referenced this pull request Feb 20, 2023
mstuartf added a commit that referenced this pull request Feb 21, 2023
* fix(PPDSC-2611): Revert "Fix/ppdsc 2611 fix 1 (#629)"

This reverts commit 7ee4a68.

* fix(PPDSC-2611): Revert "fix(PPDSC-2611): fix pipeline (#596)"

This reverts commit 1c001a9.

* fix(PPDSC-2611): Revert "chore(PPDSC-2611): fewer tests for baseline updates (#588)"

This reverts commit fd4d458.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review Please assist in getting this reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants