Skip to content

Commit

Permalink
Enable tests for --features nighly on travis
Browse files Browse the repository at this point in the history
  • Loading branch information
kngwyu committed Jun 18, 2020
1 parent 0f709d6 commit 654ab4c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
10 changes: 6 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,25 @@ jobs:
python: "3.7"
- name: Python 3.8
python: "3.8"
# Run clippy and rustfmt
env: RUN_LINT=1
- name: Python 3.9-dev
python: "3.9-dev"
- name: Minimum nightly
- name: Nightly
python: "3.7"
# Keep this synced up with build.rs and ensure that the nightly version does have clippy available
# https://static.rust-lang.org/dist/YYYY-MM-DD/clippy-nightly-x86_64-unknown-linux-gnu.tar.gz exists
env: TRAVIS_RUST_VERSION=nightly-2020-01-21
env: TRAVIS_RUST_VERSION=nightly FEATURES="nightly"
- name: PyPy3.5 7.0 # Tested via anaconda PyPy (since travis's PyPy version is too old)
python: "3.7"
env: FEATURES="pypy" PATH="$PATH:/opt/anaconda/envs/pypy3/bin"
allow_failures:
- name: Nightly
- python: 3.9-dev

env:
global:
- TRAVIS_RUST_VERSION=stable
- RUST_BACKTRACE=1
- RUN_LINT=0

before_install:
- source ./ci/travis/setup.sh
Expand Down
2 changes: 1 addition & 1 deletion ci/travis/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -e
# Use profile=minimal here to skip installing clippy
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=$TRAVIS_RUST_VERSION --profile=minimal -y
export PATH=$PATH:$HOME/.cargo/bin
if [ "$TRAVIS_JOB_NAME" = "Minimum nightly" ]; then
if [[ $RUN_LINT == 1 ]]; then
rustup component add clippy
rustup component add rustfmt
fi
Expand Down
2 changes: 1 addition & 1 deletion ci/travis/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ else
PYTHON_SYS_EXECUTABLE="/opt/anaconda/envs/pypy3/bin/pypy3" cargo build;
fi

if [ "$TRAVIS_JOB_NAME" = "Minimum nightly" ]; then
if [[ $RUN_LINT == 1 ]]; then
pip install --pre black==19.3b0
make lint
fi
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg_attr(nightly, feature(specialization))]
#![cfg_attr(feature = "nightly", feature(specialization))]
#![allow(clippy::missing_safety_doc)] // FIXME (#698)

//! Rust bindings to the Python interpreter.
Expand Down
10 changes: 3 additions & 7 deletions tests/test_compile_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ fn test_compile_errors() {
t.compile_fail("tests/ui/missing_clone.rs");
t.compile_fail("tests/ui/reject_generics.rs");
t.compile_fail("tests/ui/wrong_aspyref_lifetimes.rs");
// Since the current minimum nightly(2020-01-20) has a different error message,
// we skip this test.
// TODO(kngwyu): Remove this `if` when we update minimum nightly.
if option_env!("TRAVIS_JOB_NAME") != Some("Minimum nightly") {
t.compile_fail("tests/ui/invalid_pymethod_names.rs");
t.compile_fail("tests/ui/static_ref.rs");
}
t.compile_fail("tests/ui/static_ref.rs");
#[cfg(not(feature = "nightly"))]
t.compile_fail("tests/ui/invalid_pymethod_names.rs");
}

0 comments on commit 654ab4c

Please sign in to comment.