clockworklabs / clockworklabs/SpacetimeDB

Fix `spacetimedb-update` cargo test on Windows platforms

Open
#3,420 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
25.2k
Forks
1.1k
Avg merge
2d 7h
Merged PRs (30d)
46

Description

Running cargo test -p spacetimedb-update on a Windows platform (either PowerShell or Git Bash) fails with:

cargo test -p spacetimedb-update --bin spacetimedb-update

    Finished `test` profile [optimized + debuginfo] target(s) in 1.29s
     Running unittests src\main.rs (target\debug\deps\spacetimedb_update-f0e23902f0ebae1c.exe)

running 1 test
test cli::self_install::tests::ensure_script_help_is_up_to_date ... FAILED

failures:

---- cli::self_install::tests::ensure_script_help_is_up_to_date stdout ----

thread 'cli::self_install::tests::ensure_script_help_is_up_to_date' panicked at crates\update\src\cli\self_install.rs:118:14:
couldn't find usage function
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    cli::self_install::tests::ensure_script_help_is_up_to_date

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

error: test failed, to rerun pass `-p spacetimedb-update --bin spacetimedb-update`

The code that is failing is near:
https://github.com/clockworklabs/SpacetimeDB/blob/a02d8ba8f018ccf3715cdd9f3ead2627fcf7f68d/crates/update/src/cli/self_install.rs#L115

Possibly related to Windows not reading the return line characters correctly.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with crates/update/src/cli/self_install.rs around line 115 and reproduce the issue using cargo test -p spacetimedb-update --bin spacetimedb-update on Windows. Inspect cli::self_install::tests::ensure_script_help_is_up_to_date and the reported usage-function lookup. Done means this test passes on Windows in PowerShell and Git Bash.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, operating-systems, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.