Skip to content

Commit

Permalink
fix: clean envar after test and update task test to run unit test seq…
Browse files Browse the repository at this point in the history
…uentially
  • Loading branch information
husni-zuhdi committed Aug 17, 2024
1 parent 0b5752b commit de2b571
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ tasks:
test:
summary: Run unit test with logs
cmds:
- RUST_LOG=debug cargo test -- --nocapture
- RUST_LOG=debug cargo test -- --nocapture --test-threads=1
run:
summary: Run application with hot-reload
cmds:
Expand Down
26 changes: 26 additions & 0 deletions internal/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,19 @@ mod test {
assert_eq!(result.gh_owner, gh_owner);
assert_eq!(result.gh_repo, gh_repo);
assert_eq!(result.gh_branch, gh_branch);

env::remove_var("SVC_ENDPOINT");
env::remove_var("SVC_PORT");
env::remove_var("LOG_LEVEL");
env::remove_var("ENVIRONMENT");
env::remove_var("POSTGRES_USER");
env::remove_var("POSTGRES_PASSWORD");
env::remove_var("POSTGRES_DB");
env::remove_var("POSTGRES_HOST");
env::remove_var("POSTGRES_PORT");
env::remove_var("GITHUB_OWNER");
env::remove_var("GITHUB_REPO");
env::remove_var("GITHUB_BRANCH");
}

#[test]
Expand Down Expand Up @@ -240,5 +253,18 @@ mod test {
assert_eq!(result.gh_owner, gh_owner);
assert_eq!(result.gh_repo, gh_repo);
assert_eq!(result.gh_branch, gh_branch);

env::remove_var("SVC_ENDPOINT");
env::remove_var("SVC_PORT");
env::remove_var("LOG_LEVEL");
env::remove_var("ENVIRONMENT");
env::remove_var("POSTGRES_USER");
env::remove_var("POSTGRES_PASSWORD");
env::remove_var("POSTGRES_DB");
env::remove_var("POSTGRES_HOST");
env::remove_var("POSTGRES_PORT");
env::remove_var("GITHUB_OWNER");
env::remove_var("GITHUB_REPO");
env::remove_var("GITHUB_BRANCH");
}
}

0 comments on commit de2b571

Please sign in to comment.