Skip to content

Commit

Permalink
fix: cargo shuttle integration tests, project cmd renaming (#789)
Browse files Browse the repository at this point in the history
* fix: missing renames of project cmds

* fix: update cargo shuttle integration tests
  • Loading branch information
oddgrd authored Apr 12, 2023
1 parent dfacd2f commit 1db4ae7
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ start a deployer container:

```bash
# the --manifest-path is used to locate the root of the shuttle workspace
cargo run --manifest-path ../../../Cargo.toml --bin cargo-shuttle -- project new
cargo run --manifest-path ../../../Cargo.toml --bin cargo-shuttle -- project start
```

Deploy the example:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ And to deploy it, write:

```bash
cd hello-world
cargo shuttle project new # Only needed if project has not already been created during init
cargo shuttle project start # Only needed if project has not already been created during init
cargo shuttle deploy
```

Expand Down
2 changes: 1 addition & 1 deletion cargo-shuttle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ cargo shuttle login --api-key <your-api-key-from-browser>
To deploy your shuttle project to the cloud, run:

```sh
cargo shuttle project new
cargo shuttle project start
cargo shuttle deploy
```

Expand Down
8 changes: 2 additions & 6 deletions cargo-shuttle/tests/integration/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,15 @@ async fn cargo_shuttle_command(
}

#[tokio::test]
#[should_panic(
expected = "Could not locate the root of a cargo project. Are you inside a cargo project? You can also use `--working-directory` to locate your cargo project."
)]
#[should_panic(expected = "failed to start `cargo metadata`: No such file or directory")]
async fn fails_if_working_directory_does_not_exist() {
cargo_shuttle_command(Command::Status, "/path_that_does_not_exist")
.await
.unwrap();
}

#[tokio::test]
#[should_panic(
expected = "Could not locate the root of a cargo project. Are you inside a cargo project? You can also use `--working-directory` to locate your cargo project."
)]
#[should_panic(expected = "could not find `Cargo.toml` in `/` or any parent directory")]
async fn fails_if_working_directory_not_part_of_cargo_workspace() {
cargo_shuttle_command(Command::Status, "/").await.unwrap();
}
2 changes: 1 addition & 1 deletion common/src/models/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl From<ErrorKind> for ApiError {
ErrorKind::UserAlreadyExists => (StatusCode::BAD_REQUEST, "user already exists"),
ErrorKind::ProjectNotFound => (
StatusCode::NOT_FOUND,
"project not found. Run `cargo shuttle project new` to create a new project.",
"project not found. Run `cargo shuttle project start` to create a new project.",
),
ErrorKind::ProjectNotReady => (StatusCode::SERVICE_UNAVAILABLE, "project not ready"),
ErrorKind::ProjectUnavailable => {
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/integration/helpers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ impl Services {
///
/// * `target` - A string that describes the test target
/// * `example_path` - Path to a specific example within the examples dir, this is where
/// `project new` and `deploy` will run
/// `project start` and `deploy` will run
/// * `color` - a preferably unique `crossterm::style::Color` to distinguish test logs
pub fn new_docker<D, C>(target: D, example_path: D, color: C) -> Self
where
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
//! now if you did in in the `cargo shuttle init` flow.
//!
//! ```bash
//! $ cargo shuttle project new
//! $ cargo shuttle project start
//! ```
//!
//! Then, deploy the service with:
Expand Down

0 comments on commit 1db4ae7

Please sign in to comment.