Skip to content

Jest Integration Testing with pyln and gl-testing Network Setup #677

@ShahanaFarooqui

Description

@ShahanaFarooqui

Summary

Enable Jest integration tests to run against a real Greenlight test network by reusing the existing Python test infrastructure (pyln.testing + gl-testing).

Motivation

The Python test suite already handles spinning up full ephemeral networks — bitcoind, the Greenlight scheduler, CLN nodes, GL nodes, and an LSP — via pyln and gl-testing. The gl-sdk-napi currently has no equivalent, making true end-to-end and integration testing impossible from the JS/TS side. Reimplementing this orchestration in TypeScript would duplicate complex, already-proven logic.

Proposed Solution

  • Add a thin setup_network.py script, invoked by Jest globalSetup, that:
    • Starts a full Greenlight test network using existing pyln.testing and gl-testing fixtures
    • Registers GL nodes with the scheduler and starts their signer threads
    • Writes a JSON config file with all connection info (GL_* env vars, endpoints, cert paths, node IDs)
    • Keeps all processes alive for the duration of the Jest run
    • Use globalTeardown to cleanly stop all processes once the test suite finishes.

Acceptance Criteria

  • Network includes bitcoind, scheduler, 2 CLN nodes, 2 GL nodes, and 1 LSP Server
  • GL nodes are registered with the scheduler and operational (signer threads running)
  • Jest tests consume the generated JSON config and pass
  • globalTeardown cleanly shuts down all processes
  • Documentation updated if needed

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions