Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #308 +/- ##
===========================================
Coverage 100.00% 100.00%
===========================================
Files 28 29 +1
Lines 532 1619 +1087
===========================================
+ Hits 532 1619 +1087
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The current Sauce Labs setup tests the code in real browsers. However:
main, becauseSAUCE_USERNAMEandSAUCE_ACCESS_KEYcan't safely be exposed to PRs. So PRs get no browser test results, anddependabot-automerge, which needssaucelabs-test, is skipped on every Dependabot PR.Background
The Sauce Labs setup is there to make sure the code works in real browsers. Anything that replaces it should provide the same level of testing and verification. GitHub Actions runners can run the same real browsers. A benefit of running them on the runners is that there are no separate credentials to keep as secrets or rotate.
Solution
browser-testjob that runs the suite in Chrome, Edge and Firefox, on bothubuntu-latestandwindows-latest, as six parallel jobs.browserVersion: "latest", and fails if the browser under test isn't the version it installed.@mochify/driver-webdriverand the same mochify bundle config as the Sauce run. The difference is where the browser runs: a WebDriver server started on the runner instead ofondemand.saucelabs.com, with the tests served by mochify's local server instead of the external page. Its config is a new file,mochify.webdriver-local.cjs, excluded from coverage likemochify.webdriver.cjs.dependabot-automergenow needsbrowser-testinstead ofsaucelabs-test, so it can run on Dependabot PRs.saucelabs-test,npm run test-cloudandprepublishOnlyare unchanged. Both browser jobs can run side by side for bake time, and the Sauce job can be removed in a future PR.How to verify
See the Actions run at https://github.com/YasharF/samsam/actions/runs/34800321341. Each
browser-testjob prints the browser name, version and OS in its "Check browser version" step, and reports 602 passing and 3 pending tests.The 3 pending tests skip themselves when they don't apply, the same as in the Sauce runs:
deep-equal.test.js, "returns true for buffers with identical content": browsers have noBuffer.create-matcher.test.js, "when Symbol is not defined › should call assertType and return a matcher": it replaces modules withproxyquire, which only works in Node.match.test.js, "when engine cannot compare Map instances › throws an error": it only applies to old engines that can't compareMaps, so it also skips in Node.npm testin Node reports 604 passing and 1 pending, theMaptest, so both cover the same 605 tests.