Skip to content

Fix test for Windows upgrade check.#2477

Merged
fnando merged 4 commits intomainfrom
upgrade-check-windows
Apr 13, 2026
Merged

Fix test for Windows upgrade check.#2477
fnando merged 4 commits intomainfrom
upgrade-check-windows

Conversation

@fnando
Copy link
Copy Markdown
Member

@fnando fnando commented Apr 13, 2026

No description provided.

@github-project-automation github-project-automation bot moved this to Backlog (Not Ready) in DevX Apr 13, 2026
@fnando fnando changed the title Upgrade check windows Fix test for Windows upgrade check. Apr 13, 2026
@fnando fnando marked this pull request as ready for review April 13, 2026 20:00
@fnando fnando requested review from Copilot and mootz12 April 13, 2026 20:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to stabilize the Windows upgrade-check related tests by preventing cross-test interference from shared environment variables during parallel test execution.

Changes:

  • Mark affected unit tests as serial to avoid parallel env var mutation.
  • Update the upgrade check test to prefer STELLAR_DATA_HOME (higher priority and cross-platform) and to clear XDG_DATA_HOME.
  • Add serial_test as a dev-dependency (and update Cargo.lock accordingly).

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
cmd/soroban-cli/src/config/upgrade_check.rs Makes the upgrade check load/save test run serially and uses STELLAR_DATA_HOME for deterministic temp dir resolution.
cmd/soroban-cli/src/config/data.rs Makes the write/read cache test run serially to reduce env var test interference.
cmd/soroban-cli/Cargo.toml Adds serial_test under dev-dependencies to support serial test execution.
Cargo.lock Locks the new serial_test dependency.
Comments suppressed due to low confidence (1)

cmd/soroban-cli/src/config/data.rs:212

  • STELLAR_DATA_HOME is set for the test but never restored/removed afterward, which can leak into other tests and cause order-dependent failures. Save the original value at the start of the test and restore it at the end (or remove it if it was unset). Also, set_var can take an OsStr, so you can avoid to_str().unwrap() by passing the Path directly to prevent a potential panic on non-UTF8 paths.
    fn test_write_read() {
        let t = assert_fs::TempDir::new().unwrap();
        std::env::set_var("STELLAR_DATA_HOME", t.path().to_str().unwrap());
        let rpc_uri = Url::from_str("http://localhost:8000").unwrap();

@fnando fnando merged commit 248907d into main Apr 13, 2026
216 of 217 checks passed
@fnando fnando deleted the upgrade-check-windows branch April 13, 2026 21:15
@github-project-automation github-project-automation bot moved this from Backlog (Not Ready) to Done in DevX Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants