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

[WIP] download archive instead of cloning repo in integration tests #4703

Closed
wants to merge 3 commits into from
Closed
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
22 changes: 0 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
dist: xenial
language: bash

os:
- linux
- osx
- windows

branches:
# Don't build these branches
except:
Expand Down Expand Up @@ -51,14 +46,6 @@ install:
matrix:
fast_finish: true
include:
# Builds that are executed for every PR
- os: osx # run base tests on both platforms
env: BASE_TESTS=true
- os: linux
env: BASE_TESTS=true
- os: windows
env: CARGO_INCREMENTAL=0 BASE_TESTS=true OS_WINDOWS=true

# Builds that are only executed when a PR is r+ed or a try build is started
# We don't want to run these always because they go towards
# the build limit within the Travis rust-lang account.
Expand All @@ -84,23 +71,14 @@ matrix:
- env: INTEGRATION=rust-random/rand
if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
- env: INTEGRATION=rust-lang-nursery/futures-rs
if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
- env: INTEGRATION=Marwes/combine
if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
- env: INTEGRATION=rust-lang-nursery/failure
if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
- env: INTEGRATION=rust-lang-nursery/log
if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
- env: INTEGRATION=chronotope/chrono
if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try)
allow_failures:
- os: windows
env: CARGO_INCREMENTAL=0 BASE_TESTS=true OS_WINDOWS=true
# prevent these jobs with default env vars
exclude:
- os: linux
- os: osx
- os: windows

before_script:
- |
Expand Down
8 changes: 6 additions & 2 deletions ci/integration-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ if [[ -z "$INTEGRATION" ]]; then
exit 0
fi

CARGO_TARGET_DIR=$(pwd)/target
export CARGO_TARGET_DIR

rm ~/.cargo/bin/cargo-clippy
cargo install --force --debug --path .

echo "Running integration test for crate ${INTEGRATION}"

git clone --depth=1 "https://github.com/${INTEGRATION}.git" checkout
Copy link
Member

Choose a reason for hiding this comment

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

Couldn't this also be done with --single-branch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. But downloading tar.gz archives is about 1 second faster than using git.

Copy link
Member

Choose a reason for hiding this comment

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

So 1 second in a ~8 minute build? I think just using git should be ok then?

Copy link
Member

Choose a reason for hiding this comment

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

I would also rather keep it the current way if there is only a one-second speedup...

cd checkout || exit 1
mkdir -p "checkout/$INTEGRATION"
curl -sSL "https://github.com/$INTEGRATION/archive/master.tar.gz" | tar -xzf - -C "checkout/$INTEGRATION"
cd "checkout/$INTEGRATION" || exit 1

# run clippy on a project, try to be verbose and trigger as many warnings as possible for greater coverage
RUST_BACKTRACE=full \
Expand Down