rossmacarthur / sheldon

:bowtie: Fast, configurable, shell plugin manager
https://sheldon.cli.rs
Apache License 2.0
958 stars 21 forks source link

Don't use tests that actually make network calls #140

Open rossmacarthur opened 2 years ago

rossmacarthur commented 2 years ago

Currently Sheldon runs unit tests that make requests to download https://github.com/rossmacarthur/sheldon-test. I think this is okay for integration tests but the unit tests should rather do something like spin up a local git server (if this is possible 🤔)

grawlinson commented 2 years ago

Seems like a new failure somewhat related to this (github has disabled some requests recently):

---- lock::tests::source_lock_git_git_with_checkout stdout ----
thread 'lock::tests::source_lock_git_git_with_checkout' panicked at 'called `Result::unwrap()` on an `Err` value: failed to git clone `git://github.com/rossmacarthur/sheldon-test`

Caused by:
    remote error:
      The unauthenticated git protocol on port 9418 is no longer supported.
    Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.
    ; class=Net (12)', src/lock.rs:1069:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- lock::tests::locked_config_clean stdout ----
thread 'lock::tests::locked_config_clean' panicked at 'assertion failed: ctx.clone_dir().join(\"github.com/rossmacarthur/sheldon-test\").exists()', src/lock.rs:1398:9

failures:
    lock::tests::locked_config_clean
    lock::tests::source_lock_git_git_with_checkout

test result: FAILED. 92 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 2.53s
rossmacarthur commented 2 years ago

Yeah I disabled these tests for now https://github.com/rossmacarthur/sheldon/commit/86bbfe1204d7a58e6a5308e2d61c295ecf1790bf