Skip to content

ci: remove duplicate workspace test run#518

Merged
peer2f00l merged 6 commits into
devfrom
feature/eng-508-ci-near-integration-job-times-out-at-40m-1060s-workspace
Jul 22, 2026
Merged

ci: remove duplicate workspace test run#518
peer2f00l merged 6 commits into
devfrom
feature/eng-508-ci-near-integration-job-times-out-at-40m-1060s-workspace

Conversation

@peer2f00l

@peer2f00l peer2f00l commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • move the complete default-profile test set into Fast Tests
  • remove the duplicate full-workspace run from the NEAR job
  • narrow sandbox compilation to the 12 packages that own node-backed tests
  • preserve Postgres and contract-Wasm prebuild prerequisites
  • run the NEAR gate when its workflow definition changes

Linear: https://linear.app/templar-protocol/issue/ENG-508/ci-near-integration-job-times-out-at-40m-1060s-workspace-compile

Coverage proof

  • old Fast Tests: 4,389 identities
  • old default-profile workspace step: 4,948 identities (all 4,389 fast tests duplicated)
  • proposed Fast Tests: 4,948 identities
  • sandbox workspace vs narrowed 12-package command: identical 272-test sets
  • proposed union: same 5,220 unique identities, zero cross-job overlap

Verification

  • hosted run: https://github.com/Templar-Protocol/contracts/actions/runs/29904347593
  • Fast Tests: 4,948 passed; 9m17s job / 5m37s step / 29.386s test execution
  • NEAR: 272 passed; 38m35s job / 34m51s node step / 26m12s test execution
  • node step started 2m45s after the NEAR job began
  • local expanded fast suite: 4,948 passed
  • local narrowed sandbox suite: 272 passed
  • cargo fmt --all --check, Prettier, actionlint, and git diff --check
  • adversarial review: zero findings

This change is Reviewable

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3e9d06f2-e275-46e5-8524-45be84474035

📥 Commits

Reviewing files that changed from the base of the PR and between 3209d8e and 5b14598.

📒 Files selected for processing (8)
  • .config/nextest.toml
  • .github/workflows/test.yml
  • AGENTS.md
  • docs/src/testing.md
  • justfile
  • script/coverage.sh
  • script/sandbox-up.sh
  • service/funding-bridge/README.md

📝 Walkthrough

Summary

  • Consolidates test orchestration around just test, just test-fast, and just test-sandbox.
  • Moves the complete default-profile suite into Fast Tests and removes the duplicate workspace run from the NEAR job.
  • Narrows sandbox compilation/execution to the 12 node-backed packages while preserving PostgreSQL, sandbox-node, and contract-Wasm prerequisites.
  • Makes nextest fail closed by default and defines explicit fast/sandbox filters in justfile.
  • Reworks sandbox startup to be sourced, require SANDBOX_NODE_COUNT, prebuild contracts unconditionally, and export RPC/prebuild variables directly.
  • Updates coverage, CI path triggers, documentation, and contributor guidance; removes the obsolete script/test.sh.

Verification

  • 4,948 Fast Tests and 272 sandbox tests pass.
  • Coverage comparisons are identical with no cross-job overlap.
  • Formatting, lint, and adversarial review checks pass with zero findings.

Human review focus

  • Confirm the fast and sandbox filters remain exhaustive and mutually exclusive as packages/tests change.
  • Verify sourced sandbox environment exports propagate correctly across all supported shells and CI execution paths.
  • Review the narrowed package list and unconditional contract prebuild behavior for future node-backed or Wasm test additions.

Walkthrough

The PR centralizes fast tests, sandbox tests, and coverage under just recipes, moves test selection into explicit filters, changes sandbox startup to a sourced workflow, reuses Postgres services in CI, and updates related documentation and workflow triggers.

Changes

Unified test workflow

Layer / File(s) Summary
Test selection and sandbox orchestration
.config/nextest.toml, justfile, script/sandbox-up.sh, gateway/testing/src/bin/sandbox-host.rs
Nextest filtering and sandbox startup are coordinated through Just recipes, explicit package classification, sourced environment exports, and configurable sandbox thread counts.
Filtered coverage execution
justfile, script/coverage.sh
HTML, LCOV, and text coverage commands now receive the shared fast-test filter.
CI job and gate integration
.github/workflows/test.yml
Fast tests, NEAR integration tests, and coverage use shared Postgres services and Just commands; workflow path triggers and NEAR gate messaging are updated.
Developer test workflow guidance
AGENTS.md, README.md, docs/src/testing.md, contract/market/AGENTS.md, service/funding-bridge/README.md
Testing, sandbox, coverage, and crate-specific instructions now use the Just-based workflow. Formatting-only documentation changes are also included.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CI as GitHub Actions
  participant Justfile
  participant Postgres
  participant Sandbox as script/sandbox-up.sh
  participant Nextest
  CI->>Postgres: start shared service
  CI->>Justfile: run test-fast or test-sandbox
  Justfile->>Sandbox: start pooled neard and export RPC URLs
  Justfile->>Nextest: run explicit filtered test set
  Nextest->>Postgres: access test database
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/eng-508-ci-near-integration-job-times-out-at-40m-1060s-workspace

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Checkov (3.3.8)
.github/workflows/test.yml

Traceback (most recent call last):
File "/usr/local/bin/checkov", line 2, in
from checkov.main import Checkov
ModuleNotFoundError: No module named 'checkov'

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • LINEAR integration encountered authorization issues. Please disconnect and reconnect the integration in the CodeRabbit UI.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

CodeRabbit couldn't request changes on this pull request because it doesn't have sufficient GitHub permissions.

Please grant CodeRabbit Pull requests: Read and write permission and re-run the review.

👉 Steps to fix this

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/test.yml:
- Around line 505-536: Add a lightweight CI validation for the node-backed
package allowlist used by the “Run node-backed tests on a pooled neard sandbox”
step. Derive the expected package set from the node-backed predicate in
`.config/nextest.toml`, compare it with the packages passed via the step’s
`cargo nextest run -p` arguments, and fail loudly when they differ so the
workflow cannot silently omit tests.
- Around line 453-456: Rename the near-integration-tests job’s display name from
“NEAR / Workspace Integration Tests” to accurately describe the remaining
node-backed sandbox package tests, removing the outdated “Workspace” wording
while leaving the job key and execution configuration unchanged.
- Around line 457-471: Update the postgres service definition to reference an
immutable image digest instead of the mutable postgres:17.6 tag, while
preserving the existing PostgreSQL version and service configuration.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 260f43e0-2c15-484d-ad32-207e0758e4b5

📥 Commits

Reviewing files that changed from the base of the PR and between 5e38202 and 627929f.

📒 Files selected for processing (1)
  • .github/workflows/test.yml

Comment thread .github/workflows/test.yml
Comment thread .github/workflows/test.yml Outdated
Comment thread .github/workflows/test.yml Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3209d8e71e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread justfile Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

CodeRabbit couldn't request changes on this pull request because it doesn't have sufficient GitHub permissions.

Please grant CodeRabbit Pull requests: Read and write permission and re-run the review.

👉 Steps to fix this

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@justfile`:
- Around line 76-78: Update the sandbox_packages extraction in the justfile
recipe to run python3 script/sandbox-packages.py as a regular pipeline whose
exit status is checked, rather than inside process substitution consumed by
mapfile. Preserve array-style package handling while making extraction failures
abort the recipe before any empty package list can disable -p narrowing.

In `@script/sandbox-up.sh`:
- Around line 73-78: Separate command substitution from export in the initial
NEAR_SANDBOX_RPC_URL assignment and inside the loop so cat failures remain
visible to set -e. Assign each addr_file result to the corresponding variable
first, then export it, preserving the existing variable names and node
iteration.

In `@service/funding-bridge/README.md`:
- Line 418: Update the documented funding-bridge test command to use the
sandbox-aware gate from the justfile’s sandbox_filter instead of plain
test-fast, ensuring the node-backed templar-funding-bridge tests are included
while preserving the existing package target.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 35e5250e-f41b-4cfe-8503-84f3c779edd8

📥 Commits

Reviewing files that changed from the base of the PR and between e25c909 and 3209d8e.

📒 Files selected for processing (13)
  • .config/nextest.toml
  • .github/workflows/test.yml
  • AGENTS.md
  • README.md
  • contract/market/AGENTS.md
  • docs/src/testing.md
  • gateway/testing/src/bin/sandbox-host.rs
  • justfile
  • script/coverage.sh
  • script/sandbox-packages.py
  • script/sandbox-up.sh
  • script/test.sh
  • service/funding-bridge/README.md
💤 Files with no reviewable changes (1)
  • script/test.sh

Comment thread justfile Outdated
Comment thread script/sandbox-up.sh Outdated
Comment thread service/funding-bridge/README.md Outdated
@peer2f00l
peer2f00l merged commit 908a2c1 into dev Jul 22, 2026
27 of 28 checks passed
@peer2f00l
peer2f00l deleted the feature/eng-508-ci-near-integration-job-times-out-at-40m-1060s-workspace branch July 22, 2026 15:46
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