Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rdcm committed Nov 13, 2023
1 parent 8161c4e commit 8b36ceb
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ members = [
"domain_impl",
"host",
"infra",
"integrtion-tests",
"integration-tests",
"acl"
]

Expand Down
File renamed without changes.
File renamed without changes.
26 changes: 10 additions & 16 deletions integrtion-tests/tests/sut.rs → integration-tests/tests/sut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,10 @@ impl Sut {

let response = client.get(uri).send().await.unwrap();

if response.status() == StatusCode::OK {
let user: UserResponse = response.json().await.unwrap();

Ok(user)
} else {
Err(response.text().await.unwrap())
match response.status() {
StatusCode::OK => Ok(response.json().await.unwrap()),
StatusCode::BAD_REQUEST => Err(response.text().await.unwrap()),
code => Err(format!("unexpected status code {}", code))
}
}

Expand All @@ -68,12 +66,9 @@ impl Sut {
.await
.unwrap();

if response.status() == StatusCode::CREATED {
let user: CreatedUserIdResponse = response.json().await.unwrap();

Ok(user)
} else {
Err(response.text().await.unwrap())
match response.status() {
StatusCode::CREATED => Ok(response.json().await.unwrap()),
code => Err(format!("unexpected status code {}", code))
}
}

Expand All @@ -83,10 +78,9 @@ impl Sut {

let response = client.post(uri).json(&activity).send().await.unwrap();

if response.status() == StatusCode::OK {
Ok(())
} else {
Err(response.text().await.unwrap())
match response.status() {
StatusCode::OK => Ok(()),
code => Err(format!("unexpected status code {}", code))
}
}

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ cargo test --workspace
find . -path "*/${timestamp}/*" -name '*.profraw' -exec mv {} "./${directory_path}" \;

# generate report
grcov "${directory_path}" --binary-path target/debug -s . -o "${directory_path}" --ignore "target/debug/*" --ignore "integrtion-tests/*" --output-types html
grcov "${directory_path}" --binary-path target/debug -s . -o "${directory_path}" --ignore "target/debug/*" --ignore "integration-tests/*" --output-types html

# open report
open "./${directory_path}/html/index.html"

0 comments on commit 8b36ceb

Please sign in to comment.