# How do I create integration tests in a workspace?

**URL:** <https://users.rust-lang.org/t/how-do-i-create-integration-tests-in-a-workspace/53215>\
**Category:** help\
**Created:** [December 24, 2020, 1:53pm UTC](https://users.rust-lang.org/t/how-do-i-create-integration-tests-in-a-workspace/53215 "2020-12-24T13:53:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![benjamin123](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/benjamin123/32/17810_2.png) [@benjamin123](https://users.rust-lang.org/u/benjamin123)\
**Post date:** [December 24, 2020, 1:53pm UTC](https://users.rust-lang.org/t/how-do-i-create-integration-tests-in-a-workspace/53215/1 "2020-12-24T13:53:04Z")

</div>

The structure of my project is more or less like this

The tests of my main (app) application work,  
How do I invoke the other tests of the other workspaces?

```rust
├── app
│ ├── Cargo.toml
│ ├── src
│ └── tests <--- This works
├── domain
│ ├── Cargo.toml
│ └── src
├── infrastructure
│ ├── Cargo.toml
│ ├── src
│ └── test <--- I need to call these tests
├── README.md
├── Cargo.lock
├── Cargo.toml

```

I have seen that others create a new workspace to perform the integration tests, is there any other alternative ?

---

<div class="post-metadata">

**Author:** ![matklad](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/matklad/32/41370_2.png) [@matklad](https://users.rust-lang.org/u/matklad)\
**Post date:** [December 24, 2020, 4:42pm UTC](https://users.rust-lang.org/t/how-do-i-create-integration-tests-in-a-workspace/53215/2 "2020-12-24T16:42:09Z")

</div>

Generally, `cargo test --workspace` should run integration tests from all the crates of the workspace.

---

<div class="post-metadata">

**Author:** ![danbruder](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/danbruder/32/7083_2.png) [@danbruder](https://users.rust-lang.org/u/danbruder)\
**Post date:** [December 26, 2020, 2:00am UTC](https://users.rust-lang.org/t/how-do-i-create-integration-tests-in-a-workspace/53215/3 "2020-12-26T02:00:43Z")

</div>

I created another crate in the workspace called integration tests, which has worked out well.

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/system/32/51372_2.png) [@system](https://users.rust-lang.org/u/system)\
**Post date:** [March 26, 2021, 2:00am UTC](https://users.rust-lang.org/t/how-do-i-create-integration-tests-in-a-workspace/53215/4 "2021-03-26T02:00:57Z")

</div>

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.
