Skip to content

Commit 14fe58c

Browse files
New integration tests framework (#324)
* chore(.cursor/rules/integration-test): fix typo * refactor(integration_tests): create integration test framework with initial tests * test(integration): add app_settings and metadata_management scenarios * test(integration/account_management): add logout test * test(integration/follow_management): add scenario * fixup! refactor(integration_tests): create integration test framework with initial tests * test(integration/group_membership): add Group Membership Scenario * refactor(integration_tests): rename messaging scenario to basic messaging scenario * test(integration/advanced_messaging): add AdvancedMessagingScenario scenario Also add cleanup step after scenario execution that calls logout to remove the stored secret and reset the db * test(integration/subscription_processing): add scenario to test subscription based metadata and relay updates Also refactors account_management login to be cleaner Adjust sleeps throughout the integrationt tests * test(integration): fix tests by using updated methods * docs(integration_tests): update readme * refactor(integration_tests): registry: reorder summary info * fixup! test(integration): fix tests by using updated methods * chore(ci): use --features integration-tests to run integration tests * Update .cursor/rules/integration-test.mdc Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update src/integration_tests/README.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix: CodeRabbit comments --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent a3f0274 commit 14fe58c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+2657
-1190
lines changed

.cursor/rules/integration-test.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ alwaysApply: true
55
---
66
# Integration Test
77

8-
We have an a file at [integration_test.rs](mdc:src/bin/integration_test.rs) that is a full integration test of different functionality. This integrtion test should ALWAYS be run with the `just int-test` command and not run on it's own with different log and data directories.
8+
There is a file at [integration_test.rs](mdc:src/bin/integration_test.rs) that performs a full integration test across multiple features. This integration test should ALWAYS be run with the `just int-test` command and should not be run on its own with different log and data directories. The `int-test` recipe also enables the `integration-tests` Cargo feature.

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
if: matrix.target == 'native' && matrix.os == 'ubuntu-latest'
9191
run: |
9292
mkdir -p ./dev/data/integration_test/
93-
RUST_LOG=warn,integration_test=info cargo run --bin integration_test -- --data-dir ./dev/data/integration_test/ --logs-dir ./dev/data/integration_test/
93+
RUST_LOG=warn,sqlx=info,refinery_core=error,keyring=info,nostr_relay_pool=error,nostr_mls_sqlite_storage=error,tungstenite=error,integration_test=debug cargo run --bin integration_test --features integration-tests -- --data-dir ./dev/data/integration_test/ --logs-dir ./dev/data/integration_test/
9494
rm -rf ./dev/data/integration_test/
9595
9696
- name: Stop Docker Compose services

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"[rust]": {
33
"editor.defaultFormatter": "rust-lang.rust-analyzer"
4-
}
4+
},
5+
"rust-analyzer.cargo.features": "all"
56
}

Cargo.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,16 @@ dotenvy = "0.15"
7676
mockito = "1.2"
7777
tempfile = "3.19.1"
7878

79+
[features]
80+
default = []
81+
# Feature flag for integration tests - enables IDE support without including in production
82+
integration-tests = []
83+
84+
[[bin]]
85+
name = "integration_test"
86+
path = "src/bin/integration_test.rs"
87+
required-features = ["integration-tests"]
88+
7989
[profile.release]
8090
debug = false
8191
opt-level = "z"

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ int-test:
2121
nostr_mls_sqlite_storage=error,\
2222
tungstenite=error,\
2323
integration_test=debug \
24-
cargo run --bin integration_test -- --data-dir ./dev/data/integration_test/ --logs-dir ./dev/data/integration_test/
24+
cargo run --bin integration_test --features integration-tests -- --data-dir ./dev/data/integration_test/ --logs-dir ./dev/data/integration_test/
2525

2626
# Run all tests (unit tests, integration tests, and doc tests)
2727
test:

0 commit comments

Comments
 (0)