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

Set up basic unit test and endpoint blackbox test #27

Merged
merged 12 commits into from
Dec 22, 2023

Conversation

calebbourg
Copy link
Collaborator

@calebbourg calebbourg commented Dec 11, 2023

Description

This PR adds the ability to run a full test suite of the larger cargo workspace by running cargo test from the root. It also sets up basic patterns for unit testing organizations as well as blackbox testing of endpoints through the router.

GitHub Issue: Closes #4

Changes

  • Adds testing patterns using seaORM's mock interface
  • Runs test suite in CI

Testing Strategy

cargo test

Output:

cargo test
    Finished test [unoptimized + debuginfo] target(s) in 2.43s
     Running unittests src/main.rs (target/debug/deps/refactor_platform_rs-5bc358d6a9d68865)

running 1 test
00:29:58 [INFO] Starting up....
00:29:58 [INFO] Running tests for "entity_api" crate

00:29:58 [INFO] All "entity_api" tests completed successfully.

00:29:58 [INFO]
running 1 test
test organization::tests::find_all_returns_a_list_of_records_when_present ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


00:29:58 [INFO] Running tests for "web" crate

00:30:01 [INFO] All "web" tests completed successfully.

00:30:01 [INFO]
running 1 test
test router::organization_endpoints_tests::read_returns_succesful_json_when_organization_exists ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.09s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

Concerns

None

.github/workflows/ci.yml Outdated Show resolved Hide resolved
@jhodapp jhodapp added the feature work Specifically implementing a new feature label Dec 18, 2023
@calebbourg calebbourg marked this pull request as ready for review December 21, 2023 20:04
@jhodapp jhodapp changed the title setup basic unit test and test script Set up basic unit test and endpoint blackbox test Dec 21, 2023
@jhodapp jhodapp added the enhancement Improves existing functionality or feature label Dec 22, 2023
Copy link
Member

@jhodapp jhodapp left a comment

Choose a reason for hiding this comment

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

LGTM

@calebbourg calebbourg merged commit 3c1d94c into main Dec 22, 2023
4 checks passed
@calebbourg calebbourg deleted the add_unit_tests_for_organizations branch December 22, 2023 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improves existing functionality or feature feature work Specifically implementing a new feature
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Establish an integration test pattern by writing a single test
2 participants