fix: skip RPC tests when TESTNET/DEVNET URL is set but empty#3423
Open
radhika-kapoor wants to merge 3 commits intotempoxyz:mainfrom
Open
fix: skip RPC tests when TESTNET/DEVNET URL is set but empty#3423radhika-kapoor wants to merge 3 commits intotempoxyz:mainfrom
radhika-kapoor wants to merge 3 commits intotempoxyz:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
test_matrices_testnetandtest_matrices_devnettests were failing in CI with:Error: relative URL without a base
Location: crates/node/tests/it/tempo_transaction/rpc.rs:83:19
When a GitHub Actions secret (e.g.
TEMPO_TESTNET_RPC_URL) is unavailable for a PR,GitHub expands it to an empty string
""rather than leaving the variable unset.std::env::varreturnsOk("")for a set-but-empty variable , notErr(_), so theold guard fell through to
Self::connect(""), which panicked immediately trying toparse
""as a URL.Fix
Added
.and_then(|u| if u.is_empty() { Err(std::env::VarError::NotPresent) } else { Ok(u) })before the match in both
testnet()anddevnet(). This convertsOk("")toErr(NotPresent)before the match, so theErr(_)arm handles it the same way as atruly unset variable — returning
Ok(None)and skipping the test gracefully.""Test plan
TEMPO_TESTNET_RPC_URL="" TEMPO_DEVNET_RPC_URL="" cargo nextest run --profile ci-rpc -E 'package(tempo-node) & binary(it) & test(/test_matrices_testnet|test_matrices_devnet/)'-> 4 retries, all fail with
relative URL without a base