Skip to content

jest config doesn't separate DB-requiring integration specs from unit specs — npm run test fails without a live Postgres, with no clear signal why #177

Closed

Description

@chonilius

package.json's jest config sets rootDir: "src" and testRegex: ".*\\.spec\\.ts$" with no testPathIgnorePatterns. src/database/escrow-fk-integrity.integration.spec.ts matches that same regex (it ends in .spec.ts) but, per its own doc comment, genuinely requires a live Postgres connection (synchronize: true against a real DataSource) — unlike every other .spec.ts file in the repo, which mocks its repositories.

In CI this is invisible because the "Run Unit & Integration Tests" step explicitly provides DATABASE_URL pointing at the workflow's postgres service container — so the step name already tacitly acknowledges two different test tiers are being run together. But a contributor running npm run test locally without DATABASE_URL set (e.g. before running docker compose up -d db, or simply not realizing one .spec.ts file among ~30 needs a database) gets a Postgres connection failure mixed into what looks like a fast, dependency-free unit test run, with no jest-level distinction between "this failed because of a real bug" and "this failed because you don't have a database running."

Consider a testPathIgnorePatterns (or a separate jest project/config) excluding *.integration.spec.ts from the default npm run test script, with its own npm run test:integration script that documents the DATABASE_URL requirement explicitly — mirroring how test:e2e already gets its own script and documented prerequisite in the README.

Activity

  1. added
    testing
    on Aug 21, 2026
  2. ghzhost commented on Aug 21, 2026

    @ghzhost

    Resolved by PR #180

  3. samkay-ops commented on Aug 21, 2026

    @samkay-ops

    Hi team,
    I'm applying to work on this issue.
    I have strong experience with TypeScript, NestJS, and Soroban smart contracts. I will deliver clean, tested code following the acceptance criteria.
    Ready to start immediately.
    Best regards,
    samkay-ops

  4. added
    documentation
    architecture
    very hard
    on Aug 21, 2026
  5. added
    Stellar Wave
    on Aug 27, 2026
  6. christianahtemitope2005 commented on Aug 27, 2026

    @christianahtemitope2005
    Contributor

    @christianahtemitope2005 has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    GM GM Maintainer

    I am writing to express interest in contributing to Lingualayer org, specifically this issue. My background in Rust, combined with prior work on Similar Past Work, positions me well to deliver a robust solution within 10hrs. I would be grateful for the opportunity.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @christianahtemitope2005 to this issue.

  7. Kappa16 commented on Aug 27, 2026

    @Kappa16

    @Kappa16 has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    PLEASE , I'd like to take this on.
    I'd appreciate being assigned to this issue and look forward to contributing.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Kappa16 to this issue.

  8. drips-wave commented on Aug 27, 2026

    @drips-wave

    Congratulations, @christianahtemitope2005! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on August 31, 2026.

    🧑‍💻 @christianahtemitope2005: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  9. drips-wave commented on Aug 27, 2026

    @drips-wave

    This issue has been completed by @christianahtemitope2005 as part of the Stellar Wave Program's 8th Wave 🥳

    😎 @christianahtemitope2005: You earned 200 Points for completing this issue! After the current Wave ends, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

    🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

  10. added a commit that references this issue on Aug 30, 2026
    dd3d33c
  11. removed
    Stellar Wave
    on Oct 15, 2026
  12. added
    Stellar Wave
    on Oct 15, 2026
  13. removed
    Stellar Wave
    on Oct 15, 2026
  14. added
    Stellar Wave
    on Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Stellar Wavearchitecturedocumentationtestingvery hard

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions