Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Move Provider tests to forge_infra with sequential execution #414

Merged
merged 2 commits into from
Feb 28, 2025

Conversation

tusharmath
Copy link
Collaborator

PR: Move Provider tests to forge_infra with sequential execution

Description

This PR moves provider-related tests from forge_domain/src/provider.rs to forge_infra/src/env.rs and configures them to run sequentially, which is more appropriate for environment variable testing.

Changes

  • Add serial_test as a dev dependency to forge_infra
  • Move all Environment provider tests to env.rs
  • Add #[serial] attribute to tests to prevent race conditions when modifying environment variables
  • Remove test module from provider.rs

Motivation

The tests were manipulating environment variables but were located in the domain crate. Since forge_infra is responsible for environment interactions, this is a more appropriate location for these tests. Additionally, these tests need to run sequentially to avoid race conditions since they modify shared environment state.

Testing

  • Verified all tests run successfully in their new location with sequential execution
  • Confirmed no tests remain in the original provider.rs file

…ecution

This commit moves all provider-related tests from forge_domain/src/provider.rs
to forge_infra/src/env.rs which is a more appropriate location for environment
variable testing. Also adds the serial_test crate to ensure tests run sequentially
since they modify shared environment variables.

Changes:
- Add serial_test as a dev dependency to forge_infra
- Move all provider tests to env.rs
- Add #[serial] attribute to tests to prevent race conditions
- Remove tests from provider.rs
@tusharmath tusharmath changed the title Move Provider tests to forge_infra with sequential execution refactor: Move Provider tests to forge_infra with sequential execution Feb 28, 2025
@tusharmath tusharmath enabled auto-merge (squash) February 28, 2025 10:18
@tusharmath tusharmath merged commit 23a0c63 into main Feb 28, 2025
9 checks passed
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.

1 participant