-
-
Notifications
You must be signed in to change notification settings - Fork 345
test: feature-gate PostgreSQL tests to remove external dependencies from cargo test
#2558
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
Changes from 18 commits
d53f1f5
1448693
127895d
338eb3f
998fbbe
7ae0f09
8e7cb04
b9e39b0
575aa77
218884e
2652a0a
263e091
5ce0aec
6b8f02f
23c6721
b5b49de
c2597d3
af9ce14
31164bf
dc4241e
c84856b
0d7ebcb
461216a
cc6edf4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -143,6 +143,21 @@ | |||||||||||||||
| just stop # stop test database | ||||||||||||||||
| ``` | ||||||||||||||||
|
|
||||||||||||||||
| ### Testing | ||||||||||||||||
|
|
||||||||||||||||
| Martin's test suite includes tests that require PostgreSQL to be running and tests that don't. | ||||||||||||||||
|
|
||||||||||||||||
| ```bash | ||||||||||||||||
| # Run tests that don't require PostgreSQL (no external dependencies) | ||||||||||||||||
| just test-cargo | ||||||||||||||||
|
|
||||||||||||||||
| # Run all tests including PostgreSQL tests (requires PostgreSQL running) | ||||||||||||||||
| just test # runs all tests | ||||||||||||||||
| just test-pg # starts PostgreSQL and runs only PostgreSQL-requiring tests | ||||||||||||||||
|
Check failure on line 156 in docs/src/development.md
|
||||||||||||||||
CommanderStorm marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
CommanderStorm marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||||
| ``` | ||||||||||||||||
|
|
||||||||||||||||
| The `test-pg` feature gates tests that require a live PostgreSQL connection. This allows developers to run most tests locally without setting up PostgreSQL, while CI and integration testing can enable these tests explicitly. | ||||||||||||||||
|
||||||||||||||||
| just test # runs all tests | |
| just test-pg # starts PostgreSQL and runs only PostgreSQL-requiring tests | |
| ``` | |
| The `test-pg` feature gates tests that require a live PostgreSQL connection. This allows developers to run most tests locally without setting up PostgreSQL, while CI and integration testing can enable these tests explicitly. | |
| just test # runs all tests | |
| just test-pg # starts PostgreSQL and runs only PostgreSQL-requiring tests |
The test-pg feature gates tests that require a live PostgreSQL connection.
This allows developers to run most tests locally without setting up PostgreSQL, while CI and integration testing can enable these tests explicitly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied in 0d7ebcb - improved documentation formatting for better readability.
CommanderStorm marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #![cfg(feature = "postgres")] | ||
| #![cfg(feature = "test-pg")] | ||
|
|
||
| use indoc::indoc; | ||
| use insta::assert_yaml_snapshot; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #![cfg(feature = "postgres")] | ||
| #![cfg(feature = "test-pg")] | ||
|
|
||
| use indoc::indoc; | ||
| use insta::assert_yaml_snapshot; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.