Skip to content

Conversation

oguzkocer
Copy link
Contributor

Builds on #99.

wp_networking was initially separated, so we could the wp_api as a dependency crate, rather than an internal one. Later on wp_networking became an integration test suite and in Rust, integration tests already treat the crate as a dependency, so there is no benefit left in keeping them separate.

The PR merges wp_networking into wp_api by:

  • Moving wp_networking dependencies to wp_api's dev-dependencies.
  • Moving the tests folder as a whole to wp_api.
  • Moving the contents of wp_networking/src/lib.rs to tests/test_helpers. Note the only implementation here was AsyncWPNetworking which for now is only needed for integration tests. I think one day we might add a default client to wp_api itself, but for now this should be enough.

As a bonus, I've renamed the src/test_helpers to src/unit_test_common in 1c0f443 and tests/test_helpers to tests/integration_test_common in 8da085a. Both of these modules having the same name was very annoying when browsing the code and I'd like to move away from the helper suffix as much as possible, so I picked these for now. Happy to change it again if you have a suggestion for a better name.


To Test

  • make test-server && make dump-mysql && make backup-wp-content-plugins
  • cargo test --test '*' -- --nocapture --test-threads 1

@oguzkocer oguzkocer added the Rust label May 22, 2024
@oguzkocer oguzkocer added this to the 0.1 milestone May 22, 2024
@oguzkocer oguzkocer requested review from crazytonyli and jkmassel May 22, 2024 15:49
Base automatically changed from rename-wp-derive-to-wp-contextual to trunk May 22, 2024 17:02
@oguzkocer oguzkocer force-pushed the merge-wp-networking-crate-to-wp-api branch from 8da085a to a4eb9bb Compare May 22, 2024 17:03
@oguzkocer oguzkocer enabled auto-merge (squash) May 22, 2024 17:42
@oguzkocer oguzkocer merged commit d615c87 into trunk May 22, 2024
@oguzkocer oguzkocer deleted the merge-wp-networking-crate-to-wp-api branch May 22, 2024 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants