Skip to content

Move live-network DOI/ORCID tests out of the required pure tier - #963

Merged
neuromechanist merged 1 commit into
devfrom
fix/flaky-doi-orcid-test
Jul 20, 2026
Merged

neuromechanist merged 1 commit into
devfrom
fix/flaky-doi-orcid-test

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Summary

test/doi-orcid-discovery.test.ts mixed deterministic offline tests (DOI extraction, creator matching) with queryDataCiteDoi/discoverOrcidsFromReferencedDois tests that hit the live DataCite/Crossref APIs. The pure-tier classifier only excluded files matching testRequest|TEST_API_URL|runCli, so these network tests ran in unit-pure at the 5000ms default timeout and intermittently flaked — a real occurrence blocked release PR #961. Since #897 wired the pure tier into deploy-backend.yml's test-gate, that flake can also block a production deploy.

Change

  • Split the two network describe blocks into test/doi-orcid-discovery.integration.test.ts.
  • Taught all three classifiers (test.yml pure + integration, deploy-backend.yml test-gate) a *.integration.test.ts convention: excluded from the required/offline pure tier, included in the integration tier which already runs --retry=2 --timeout 30000.
  • doi-orcid-discovery.test.ts keeps the 24 deterministic offline tests.

Test plan

  • Classifier simulation: doi-orcid-discovery.test.ts -> pure, .integration.test.ts -> integration.
  • Offline tests: 24 pass, 110ms, no network.
  • Network tests (moved): 11 pass against the live API (2.6s) with retry/timeout.
  • biome check src/ clean; both workflow YAMLs parse.

Part of the dev->main release-safety hardening (#961).

test/doi-orcid-discovery.test.ts mixed deterministic offline tests with
queryDataCiteDoi/discoverOrcidsFromReferencedDois tests that hit the live
DataCite/Crossref APIs. The pure-tier classifier only excluded files matching
testRequest|TEST_API_URL|runCli, so these network tests ran in unit-pure with
the 5000ms default timeout and intermittently flaked (a real one blocked #961).
Since #897 wired the pure tier into deploy-backend.yml's test-gate, that flake
can also block a production deploy.

Split the network tests into doi-orcid-discovery.integration.test.ts and teach
all three classifiers a *.integration.test.ts convention: excluded from the
required pure tier, run in the integration tier (--retry=2 --timeout 30000).
Offline tests (24) stay pure; network tests (11) pass in integration.
@neuromechanist
neuromechanist merged commit ebc8467 into dev Jul 20, 2026
10 checks passed
@neuromechanist
neuromechanist deleted the fix/flaky-doi-orcid-test branch July 20, 2026 23:53

This branch was previously deployed

1 inactive deployment
npm — b3e09019 Deployed Jul 20, 2026 by neuromechanist via publish #1757
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.

1 participant