Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration Test #144

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
Draft

Conversation

rail-rain
Copy link
Collaborator

@rail-rain rail-rain commented Nov 13, 2024

Right now, it's just a rough demo of trycmd with one test case for Tamanu Alerts.

@passcod
Copy link
Member

passcod commented Nov 17, 2024

love it! would be great to disable logging when testing as that's unlikely to ever be useful test output

@rail-rain
Copy link
Collaborator Author

Would you disable all logging? I thought warnings may be useful to test. For example, when a shell alert source times out, a warning-level log is the only way to know that it timed out. I agree that testing info-level logs is mostly useless.

@passcod
Copy link
Member

passcod commented Nov 18, 2024

good call. limiting to warning and up by default at least would be best; also would be nice to find a way to kill colour usage for tests so it doesn't have all the [33m etc escapes

It also responds to env var BESTOOL_TIMELESS for removing timestamps. This makes it easier to configure multiple tests via env vars.
Also delete logic to remove time from logs as it's not longer needed. Leave the logic to print logs to stderr with RUST_LOG mode intact.
Add time to the template to test mocked time
@rail-rain rail-rain force-pushed the test/kam-294-bestool-integration-tests branch from cd009b2 to 3151539 Compare November 27, 2024 02:32

let handle_res = init_db().and_then(run_db);

if matches!(handle_res, Err(_)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if matches!(handle_res, Err(_)) {
if handle_res.is_err() {

@@ -110,3 +117,73 @@ fn stop_db(temp_dir: TempDir) -> Result<()> {

Ok(())
}

pub fn find_postgres_bin(name: &str) -> Result<OsString> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this copied from the lib? can we expose that and re-use instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants