Skip to content

Skip Hyperswarm P2P tests in CI environments#84

Merged
kayodebristol merged 4 commits intomainfrom
copilot/skip-hyperswarm-tests-ci
Feb 17, 2026
Merged

Skip Hyperswarm P2P tests in CI environments#84
kayodebristol merged 4 commits intomainfrom
copilot/skip-hyperswarm-tests-ci

Conversation

Copy link
Contributor

Copilot AI commented Feb 16, 2026

Hyperswarm tests block CI due to udx-native native module failures in Deno and network instability. Skip network-dependent tests in CI while preserving full coverage locally.

Changes

Test files - Add CI detection pattern:

// Deno tests
const isCI = Deno.env.get("CI") === "true";
Deno.test({ name: "...", ignore: isCI, fn: ... });

// Node.js tests  
if (process.env.CI === "true") {
  console.log("⏭️  Skipping tests in CI");
  process.exit(0);
}

Files modified:

  • legacy/tests/unit/hyperswarm-sync.test.ts - Skip network test via ignore: isCI
  • tests/hyperswarm-integration.test.js - Early exit in CI with message
  • legacy/tests/integration/mesh-network.test.ts - Enhanced skip logic: shouldRun = explicitlyEnabled || !isCI

Documentation:

  • docs/TESTING.md - Added Hyperswarm CI isolation section
  • README.md - Note about CI test behavior

Behavior

Environment Network Tests Override
CI (CI=true) Skip RUN_MESH_TESTS=true
Local (CI unset) Run -

Validation tests (key format, database ready checks) run in all environments - they don't import Hyperswarm.

Impact

  • Unblocks release pipeline
  • CI feedback under 2 minutes vs timing out
  • Full P2P integration testing preserved for local development
Original prompt

This section details on the original issue you should resolve

<issue_title>Practice: Hyperswarm test environment isolation for CI reliability</issue_title>
<issue_description>## Problem
Deno Hyperswarm tests fail in CI environment, blocking pluresdb releases. Network-dependent tests create CI instability.

Current impact

Proposed solution

Isolate network-dependent tests from CI pipeline:

  1. Option A: Skip Hyperswarm tests in CI, run only in local development
  2. Option B: Mock transport layer for CI testing
  3. Option C: Use in-memory/local-only test network for CI

Implementation preference

Start with Option A for immediate unblocking:

  • Add CI detection in test suite
  • Skip network tests when CI environment detected
  • Preserve full test coverage for local development
  • Consider future mocking for better CI coverage

ROI

  • Unblocks releases immediately
  • Maintains test coverage in development environment
  • Reduces CI maintenance overhead
  • Enables reliable automated releases

Acceptance criteria

  • CI tests pass consistently without network dependencies
  • Local development retains full Hyperswarm test coverage
  • Release pipeline functions reliably
  • Test skip behavior clearly documented

Related: Issue #79, Draft PR #80
Source: Weekly practices review 2026-02-16</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits February 16, 2026 19:38
- Add CI environment detection (CI=true) to all Hyperswarm test files
- Skip network-dependent tests in CI while preserving local coverage
- Update test documentation with CI isolation details
- Add clear skip messages explaining why tests are skipped

Affected files:
- legacy/tests/unit/hyperswarm-sync.test.ts: CI detection + skip network test
- tests/hyperswarm-integration.test.js: Complete skip in CI with message
- legacy/tests/integration/mesh-network.test.ts: Enhanced skip logic with CI awareness
- docs/TESTING.md: Added comprehensive CI test isolation section
- README.md: Added note about CI test behavior

Resolves: Hyperswarm test instability in CI (issue #79, PR #80)
Benefits: Reliable automated releases, fast CI feedback, full local coverage

Co-authored-by: kayodebristol <3579196+kayodebristol@users.noreply.github.com>
- Simplify Node.js test skip message (remove CI=false from instructions)
- Clarify Deno test instructions to explain runtime limitations
- Improve documentation about Deno native module incompatibility
- Make test execution commands more user-friendly

Addresses code review feedback on PR for issue #79

Co-authored-by: kayodebristol <3579196+kayodebristol@users.noreply.github.com>
- Clarify that CI is unset by default in local environments
- Remove confusing CI=false instructions (string "false" doesn't work as expected)
- Emphasize that simply running tests locally is sufficient
- Improve explanation of Deno native module limitations

Final improvements addressing all code review feedback

Co-authored-by: kayodebristol <3579196+kayodebristol@users.noreply.github.com>
Copilot AI changed the title [WIP] Skip Hyperswarm tests in CI for reliability Skip Hyperswarm P2P tests in CI environments Feb 16, 2026
Copilot AI requested a review from kayodebristol February 16, 2026 19:43
@kayodebristol kayodebristol marked this pull request as ready for review February 17, 2026 07:20
@kayodebristol kayodebristol merged commit 87789bd into main Feb 17, 2026
3 checks passed
@kayodebristol kayodebristol deleted the copilot/skip-hyperswarm-tests-ci branch February 17, 2026 07:20
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.

Practice: Hyperswarm test environment isolation for CI reliability

2 participants