test: run the cloak-profile integration test in CI - #31
Merged
Merged
Conversation
The file was in no test script. It also passed browserPath: findCloakBrowserPath(), which only globs a macOS CloakBrowser install, so CLOAKBROWSER_BIN was ignored. And it asserted navigator.webdriver === false, which only CloakBrowser's patched binary reports; the stock chrome-headless-shell in CI reports true. Split it into two tests: - Profile persistence (site state and fingerprint seed reused across relaunches) goes through connectCloakProfile's CLOAKBROWSER_BIN default, so it runs on any Chromium, including CI. - The navigator.webdriver check needs a real CloakBrowser and skips with a reason when none is installed. Add the file to both test scripts.
Owner
Author
|
CI evidence (https://github.com/code-yeongyu/omowright/actions/runs/36784678420):
|
Closed
3 tasks
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.
Summary
Routing node R4: run
test/cloak-profile.integration.test.mjsin CI. It was in neither test script, and two things stopped it running as written:findCloakBrowserPath()directly. That function only globs a macOS CloakBrowser install, so theCLOAKBROWSER_BINthat CI sets was ignored and the test would throw on Linux.navigator.webdriver === false. Only CloakBrowser's patched binary reports that. The stockchrome-headless-shellthat CI installs reportstrue; locally that assertion fails withactual: { webdriver: true, value: 'persisted' }.The test is now split in two:
connectCloakProfile's default, which resolvesCLOAKBROWSER_BINfirst, so it runs on any Chromium, CI included. It skips only when no browser exists at all.navigator.webdriveron a reused profile. It needs a real CloakBrowser and skips with a reason when none is installed. CI does not have one; adding a third-party CloakBrowser download to CI is a separate decision.Both use the repo's existing
{ skip, timeout: 60000 }pattern for live tests. The file is added totestandtest:node.Baseline gate (unedited base
de08f48b)The original file under
node --testwith a real local CloakBrowser: 1 pass. Underbun test: 1 fail, from the default 5 s timeout on a two-launch test.After this change:
CLOAKBROWSER_BIN(what CI has)Mutation proof
src/cloak-profile.jslaunches with a fresh--user-data-direach time instead of the profile directory. The routed persistence test fails: ℹ pass 0 ℹ fail 1. Restored;git diff --quiet -- srcexits 0.Audit numstat (frozen measurement tool, merge-base..head)
Removed: test 31, support 0, prod 0. Added: test 39, support 0, prod 0. Test files delta: 0.
Verify
The CI log on this PR should list
cloak-profile.integration.test.mjsin both thebun testandnode --teststeps, with 1 pass and 1 skip.Refs #28
Summary by cubic
Runs the cloak-profile integration test in CI. Previously it wasn't in any test script, only found a macOS CloakBrowser install via
findCloakBrowserPath(), and assertednavigator.webdriver === falsewhich fails on the stock Chromium that CI installs.connectCloakProfile'sCLOAKBROWSER_BINdefault), and thenavigator.webdrivercheck requires a real CloakBrowser and skips with a reason if none is installed.testandtest:nodescripts.Written for commit 2bd7df2. Summary will update on new commits.