[pull] main from TryGhost:main#1167
Merged
Merged
Conversation
`ghost/core`'s unit tests fail intermittently on `main` CI. Two distinct things were found: - The previously-skipped `cache-invalidation` test was a genuine timeout. `testTimeout` was 2000ms — a mocha holdover; under vitest's per-file isolation the cold-import cost makes that too tight on a loaded runner. - The *remaining* failures are not clean timeouts — vitest's `github-actions` reporter emits no test-level annotation, so the ghost/core vitest process is exiting abnormally (a worker crash), not failing a reported test. It could not be reproduced locally (12/12 clean); it is specific to loaded CI runners. This is interim stabilization, not the root fix: - **`testTimeout` 2000ms → 5000ms** — clears the timeout-flake class with no loss of coverage. - **`retry: 2` in vitest config** — retries a failed test up to twice (3 attempts), absorbing transient test-level failures. - **CI step retry (up to 3 attempts)** on the "Run unit tests" step — masks the intermittent worker crash; nx caching means a retry only re-runs the crashed project. - **CI console reporter `dot` → `default`** — `dot` emits only dots, so a crash leaves no clue which file was running; `default` names each file. `github-actions` annotations are kept for clean per-failure reporting.
no ref - use the numeric keyCode path for the admin search shortcut test helper so keymaster sees the shortcut consistently across Chrome versions - stub the billing iframe component's message wrapper instead of mutating cross-origin iframe contentWindow.postMessage - avoid pipefail/SIGPIPE when selecting the first Docker image tag from multiline image tag input ## Context This came out of investigating failures on #28047 while testing Blacksmith runners. The changes are not Blacksmith-specific; they harden tests and CI shell behavior that can vary by browser/runtime.
no ref - verify the application route still registers Ctrl/Cmd+K to open the search modal - open the search modal through the registered route action for the rest of the search behavior coverage - avoids depending on Chrome-version-specific behavior in synthetic global keyboard events ## Context This was found while validating Blacksmith runners in #28047. Blacksmith's Admin tests lane uses system Chrome 144, where Ember's synthetic global keydown did not reliably exercise keymaster and all search modal tests failed before reaching the behavior under test. The change is intentionally not Blacksmith-specific. This PR separates the browser-sensitive test hardening from the runner migration and lets it validate independently on the normal GitHub Actions path.
no ref `test/unit/frontend/helpers/meta-title.test.js` — the `with meta_title` block stubs `settingsCache.get` in its first test and its remaining tests rely on that stub staying in place, but the stub is never restored.
Updated portal strings for gift subs and retention, zh and zh-Hant
no ref The ghost/core unit suite ran under vitest's default `isolate: true` — a fresh module registry per test file, cold-importing Ghost's heavy server modules ~550 times per run. It now runs under `isolate: false` (one shared registry per worker, the model mocha always used): **~73s → ~7s locally.**
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )