Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Update run.sh and appveyor config for tests #1955

Merged
merged 2 commits into from
Jul 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,23 @@ build: false
test_script:
- cargo build --release --target %TARGET% --locked
- cargo run --release --target %TARGET% --locked -- --dump-testament
- cargo test --release --target %TARGET%
# The rest of this relies on the set of things to test not changing
# because I have no idea how to script it. TODO: Get someone to script it?
- cargo test --release --target %TARGET% -p download
- cargo test --release --target %TARGET% --bin rustup-init
- cargo test --release --target %TARGET% --lib --all
- cargo test --release --target %TARGET% --doc --all
- cargo test --release --target %TARGET% --test cli-exact
- cargo test --release --target %TARGET% --test cli-inst-interactive
- cargo test --release --target %TARGET% --test cli-misc
- cargo test --release --target %TARGET% --test cli-rustup
- cargo test --release --target %TARGET% --test cli-self-upd
- cargo test --release --target %TARGET% --test cli-v1
- cargo test --release --target %TARGET% --test cli-v2
- cargo test --release --target %TARGET% --test dist_install
- cargo test --release --target %TARGET% --test dist_manifest
- cargo test --release --target %TARGET% --test dist -- --test-threads 1
- cargo test --release --target %TARGET% --test dist_transactions

notifications:
- provider: Webhook
Expand Down
20 changes: 16 additions & 4 deletions ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,23 @@ fi
# shellcheck disable=SC2086
cargo build --locked -v --release --target "$TARGET" $FEATURES

runtest () {
# shellcheck disable=SC2086
cargo test --release --target "$TARGET" $FEATURES "$@"
}

if [ -z "$SKIP_TESTS" ]; then
# shellcheck disable=SC2086
cargo run --locked --release --target "$TARGET" $FEATURES -- --dump-testament
# shellcheck disable=SC2086
cargo test --release -p download --target "$TARGET" $FEATURES
# shellcheck disable=SC2086
cargo test --release --target "$TARGET" $FEATURES
runtest -p download
runtest --bin rustup-init
runtest --lib --all
runtest --doc --all
for TEST in $(cd tests; ls *.rs | cut -d. -f1); do
if [ "x$TEST" = "xdist" ]; then
runtest --test "$TEST" -- --test-threads 1
else
runtest --test "$TEST"
fi
done
fi
5 changes: 3 additions & 2 deletions src/utils/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -767,13 +767,14 @@ mod tests {
#[test]
fn test_cargo_home() {
// CARGO_HOME unset, we'll get the default ending in /.cargo
env::remove_var("CARGO_HOME");
let cargo_home1 = cargo_home();
let ch = format!("{}", cargo_home1.unwrap().display());
assert!(ch.contains("/.cargo"));
assert!(ch.contains("/.cargo") || ch.contains("\\.cargo"));

env::set_var("CARGO_HOME", "/test");
let cargo_home2 = cargo_home();
assert_eq!("/test", format!("{}", cargo_home2.unwrap().display()));
assert!(format!("{}", cargo_home2.unwrap().display()).contains("/test"));
}

#[test]
Expand Down