Skip to content

Conversation

@aorumbayev
Copy link
Contributor

@aorumbayev aorumbayev commented Dec 8, 2025

Proposed Changes

Updates the testing infrastructure to connect to externally managed mock servers instead of managing them internally via Docker.

This change simplifies the test setup, improves consistency with the Python SDK, and allows for more flexible mock server configurations.

The mock servers are now started and stopped separately, either via GitHub Actions in CI or manually for local development. The test framework connects to these servers using environment variables.
Refactors the test setup to leverage the algokit-polytest action for managing mock servers, providing a more robust and maintainable solution for integration tests.

This change:
- Updates the PR workflow to include the `decoupling-bun-mock-server` branch
- Removes the local mock server start script
- Uses the `algokit-polytest` action to start the mock servers
- Adds a `--silent` flag to the test command to reduce output verbosity
- Updates testing package to leverage default ports

This ensures a consistent mock server environment and simplifies the setup process.
@aorumbayev aorumbayev force-pushed the decoupling-bun-mock-server branch from 691c9cc to a1559d0 Compare December 8, 2025 18:00
@aorumbayev aorumbayev changed the title refactor: change test setup to use external mock servers refactor: change test setup to use external mock servers without docker Dec 8, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the test infrastructure from Docker-based mock servers to externally managed mock servers. The change removes local Docker container management logic in favor of relying on GitHub Actions (in CI) or manually started mock servers (for local development). This simplifies the test setup by delegating server lifecycle management to the algokit-polytest project.

  • Replaced Docker-based mock server management with external server connections via environment variables
  • Updated CI workflow to use dedicated GitHub Actions for starting mock servers
  • Revised documentation to guide developers on starting mock servers locally using algokit-polytest scripts

Reviewed changes

Copilot reviewed 6 out of 67 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/testing/src/mockServer.ts Removed Docker container management code; replaced startMockServer with simpler getMockServer that reads from environment variables
packages/testing/src/index.ts Updated exports to remove Docker-specific functions and export new checkServerHealth function
packages/testing/src/globalSetup.ts Simplified setup/teardown logic to connect/disconnect rather than start/stop containers
packages/algod_client/tests/*.test.ts Added numerous new test files with placeholder implementations
packages/algod_client/tests/__snapshots__/*.snap Added snapshot files for new test cases
package.json Removed mock-server:start-algod script
package-lock.json Added peer: true flags to various dependencies
README.md Updated documentation with instructions for using external mock servers locally
.github/workflows/pr.yml Restructured workflow to use algokit-polytest GitHub Actions for mock server management

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aorumbayev aorumbayev force-pushed the decoupling-bun-mock-server branch from 774021d to 5935c9a Compare December 8, 2025 20:48
@aorumbayev aorumbayev force-pushed the decoupling-bun-mock-server branch from 5935c9a to db3c908 Compare December 8, 2025 20:48
@aorumbayev aorumbayev marked this pull request as ready for review December 8, 2025 20:49

**Local development:**

1. Clone algokit-polytest and start the mock servers:
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't you have the polytest repo locally when after running npm run polytest:validate-algod. Maybe it's better to document the flow using npm run commands.

README.md Outdated
git clone https://github.com/algorandfoundation/algokit-polytest.git

# Start all mock servers (recommended)
cd algokit-polytest/resources/mock-server
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it makes sense to have an npm run command for this.


2. Set environment variables and run tests:

```bash
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably need to add where these should be configured.

README.md Outdated
./scripts/stop_all_servers.sh
```

| Environment Variable | Description | Default Port |
Copy link
Contributor

Choose a reason for hiding this comment

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

The env info is probably better placed in step 2

@aorumbayev aorumbayev merged commit dd9a6b1 into decoupling Dec 9, 2025
3 checks passed
@aorumbayev aorumbayev deleted the decoupling-bun-mock-server branch December 9, 2025 16:56
@engineering-ci
Copy link
Contributor

🎉 This PR is included in version 10.0.0-alpha.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants