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

Skip failing tests for Linux/MIPS/PowerPC #590

Merged
merged 8 commits into from
Jun 11, 2017
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
59 changes: 31 additions & 28 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,52 +6,57 @@ language: rust
services: docker
sudo: required

# This is the Rust channel that build jobs will use by default but can be
# overridden on a case by case basis down below
rust: 1.13.0
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason not to use a default rust value? It makes the matrix section more duplicative.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you use the default, you end up with an "extra" test run. You can see how there's two x86-64-unknown-linux-gnu runs that execute right now. This fixes that problem. Looks like I didn't specify that in the commit message, which I can do.


env:
global:
- CRATE_NAME=nix
- CARGO_TEST_THREADS=1

# default job
- TARGET=x86_64-unknown-linux-gnu

matrix:
# These are all the build jobs. Adjust as necessary. Comment out what you
# don't need
include:
# Linux
- env: TARGET=aarch64-unknown-linux-gnu
rust: 1.13.0
- env: TARGET=arm-unknown-linux-gnueabi
rust: 1.13.0
# - env: TARGET=arm-unknown-linux-musleabi
- env: TARGET=armv7-unknown-linux-gnueabihf
rust: 1.13.0
- env: TARGET=i686-unknown-linux-gnu
rust: 1.13.0
- env: TARGET=i686-unknown-linux-musl
# - env: TARGET=x86_64-unknown-linux-gnu # this is the default job
rust: 1.13.0
- env: TARGET=mips-unknown-linux-gnu
rust: 1.13.0
# - env: TARGET=mips64-unknown-linux-gnuabi64
# - env: TARGET=mips64el-unknown-linux-gnuabi64
- env: TARGET=mipsel-unknown-linux-gnu
rust: 1.13.0
- env: TARGET=powerpc-unknown-linux-gnu
rust: 1.13.0
# - env: TARGET=powerpc64-unknown-linux-gnu
# - env: TARGET=powerpc64le-unknown-linux-gnu
# - env: TARGET=s390x-unknown-linux-gnu
- env: TARGET=x86_64-unknown-linux-gnu
rust: 1.13.0
- env: TARGET=x86_64-unknown-linux-musl
rust: 1.13.0

# OSX
- env: TARGET=i686-apple-darwin
rust: 1.13.0
os: osx
- env: TARGET=x86_64-apple-darwin
rust: 1.13.0
os: osx

# *BSD
- env: TARGET=i686-unknown-freebsd DISABLE_TESTS=1
rust: 1.13.0
# - env: TARGET=x86_64-unknown-freebsd DISABLE_TESTS=1 # Uses BuildBot instead
- env: TARGET=x86_64-unknown-netbsd DISABLE_TESTS=1

# Other architectures
- env: TARGET=aarch64-unknown-linux-gnu
- env: TARGET=armv7-unknown-linux-gnueabihf
- env: TARGET=mips-unknown-linux-gnu
# - env: TARGET=mips64-unknown-linux-gnuabi64
# - env: TARGET=mips64el-unknown-linux-gnuabi64
- env: TARGET=mipsel-unknown-linux-gnu
- env: TARGET=powerpc-unknown-linux-gnu
# - env: TARGET=powerpc64-unknown-linux-gnu
# - env: TARGET=powerpc64le-unknown-linux-gnu
# - env: TARGET=s390x-unknown-linux-gnu
- env: TARGET=arm-unknown-linux-gnueabi
# - env: TARGET=arm-unknown-linux-musleabi
rust: 1.13.0

# Testing beta on main targets
- env: TARGET=x86_64-unknown-linux-gnu
Expand All @@ -77,12 +82,8 @@ matrix:
- env: TARGET=x86_64-apple-darwin
os: osx
rust: nightly
# FIXME: targets that should pass but are currently failing
- env: TARGET=i686-unknown-linux-musl
- env: TARGET=x86_64-unknown-linux-musl
- env: TARGET=mips-unknown-linux-gnu
- env: TARGET=mipsel-unknown-linux-gnu
- env: TARGET=powerpc-unknown-linux-gnu

before_install: set -e

install:
- sh ci/install.sh
Expand All @@ -91,6 +92,8 @@ install:
script:
- bash ci/script.sh

after_script: set +e

before_deploy:
- sh ci/before_deploy.sh

Expand Down
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,16 @@ pub fn gethostname(name: &mut [u8]) -> Result<()>;

## Supported Platforms

nix target support consists of three tiers:
nix target support consists of two tiers. While nix attempts to support all
platforms supported by [libc](https://github.com/rust-lang/libc), only some
platforms are actively supported due to either technical or manpower
limitations. Support for platforms is split into two tiers:

* Tier 1 - Target is supported and CI both builds and tests
* Tier 2 - Target is supported and CI builds the target
* Tier 3 - Target is supported and CI both builds and tests but test failures
do not block merging code
* Tier 1 - Builds and tests for this target are run in CI. Failures of either
block the inclusion of new code.
* Tier 2 - Builds for this target are run in CI. Failures during the build
blocks the inclusion of new code. Tests may be run, but failures
in tests don't block the inclusion of new code.

The following targets are all supported by nix on Rust 1.13.0 or newer:

Expand All @@ -50,18 +54,16 @@ Tier 1:
* armv7-unknown-linux-gnueabihf
* arm-unknown-linux-gnueabi
* x86_64-unknown-freebsd
* powerpc-unknown-linux-gnu
* mips-unknown-linux-gnu
* mipsel-unknown-linux-gnu
* i686-unknown-linux-musl
* x86_64-unknown-linux-musl

Tier 2:
* i686-unknown-freebsd
* x86_64-unknown-netbsd

Tier 3:
* i686-unknown-linux-musl
* x86_64-unknown-linux-musl
* mips-unknown-linux-gnu
* mipsel-unknown-linux-gnu
* powerpc-unknown-linux-gnu

## Usage

To use `nix`, first add this to your `Cargo.toml`:
Expand Down
17 changes: 10 additions & 7 deletions ci/install.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
set -ex

main() {
curl https://sh.rustup.rs -sSf | \
sh -s -- -y --default-toolchain $TRAVIS_RUST_VERSION

local target=
if [ $TRAVIS_OS_NAME = linux ]; then
target=x86_64-unknown-linux-gnu
target=x86_64-unknown-linux-musl
sort=sort
else
target=x86_64-apple-darwin
sort=gsort # for `sort --sort-version`, from brew's coreutils.
fi

# TODO At some point you'll probably want to use a newer release of `cross`,
# simply change the argument to `--tag`.
# This fetches latest stable release
local tag=$(git ls-remote --tags --refs --exit-code https://github.com/japaric/cross \
| cut -d/ -f3 \
| grep -E '^v[0.1.0-9.]+$' \
| $sort --version-sort \
| tail -n1)
curl -LSfs https://japaric.github.io/trust/install.sh | \
sh -s -- \
--force \
--git japaric/cross \
--tag v0.1.4 \
--tag $tag \
--target $target
}

Expand Down
18 changes: 18 additions & 0 deletions test/sys/test_aio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ fn poll_aio(mut aiocb: &mut AioCb) -> Result<()> {
// bindings. So it's sufficient to check that AioCb.cancel returned any
// AioCancelStat value.
#[test]
#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)]
Copy link
Member

Choose a reason for hiding this comment

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

So all of these tests fail in x86_64 musl but pass in i686 musl? Weird. Does cross use qemu to run i686 tests? I would think that it wouldn't need to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You bring up a good point. i don't think cross runs things in QEMU based on this line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But I've filed an issue (cross-rs/cross#107) in order for this to be made more clear.

fn test_cancel() {
let wbuf: &'static [u8] = b"CDEF";

Expand All @@ -50,6 +51,7 @@ fn test_cancel() {

// Tests using aio_cancel_all for all outstanding IOs.
#[test]
#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)]
fn test_aio_cancel_all() {
let wbuf: &'static [u8] = b"CDEF";

Expand All @@ -73,6 +75,7 @@ fn test_aio_cancel_all() {
}

#[test]
#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)]
fn test_fsync() {
const INITIAL: &'static [u8] = b"abcdef123456";
let mut f = tempfile().unwrap();
Expand All @@ -88,6 +91,7 @@ fn test_fsync() {


#[test]
#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)]
fn test_aio_suspend() {
const INITIAL: &'static [u8] = b"abcdef123456";
const WBUF: &'static [u8] = b"CDEF";
Expand Down Expand Up @@ -129,6 +133,7 @@ fn test_aio_suspend() {
// Test a simple aio operation with no completion notification. We must poll
// for completion
#[test]
#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)]
fn test_read() {
const INITIAL: &'static [u8] = b"abcdef123456";
let rbuf = Rc::new(vec![0; 4].into_boxed_slice());
Expand All @@ -154,6 +159,7 @@ fn test_read() {

// Tests from_mut_slice
#[test]
#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)]
fn test_read_into_mut_slice() {
const INITIAL: &'static [u8] = b"abcdef123456";
let mut rbuf = vec![0; 4];
Expand All @@ -178,8 +184,10 @@ fn test_read_into_mut_slice() {
}

// Test reading into an immutable buffer. It should fail
// FIXME: This test fails to panic on Linux/musl
#[test]
#[should_panic(expected = "Can't read into an immutable buffer")]
#[cfg_attr(target_env = "musl", ignore)]
fn test_read_immutable_buffer() {
let rbuf: &'static [u8] = b"CDEF";
let f = tempfile().unwrap();
Expand All @@ -196,6 +204,7 @@ fn test_read_immutable_buffer() {
// Test a simple aio operation with no completion notification. We must poll
// for completion. Unlike test_aio_read, this test uses AioCb::from_slice
#[test]
#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)]
fn test_write() {
const INITIAL: &'static [u8] = b"abcdef123456";
let wbuf = "CDEF".to_string().into_bytes();
Expand Down Expand Up @@ -233,7 +242,9 @@ extern fn sigfunc(_: c_int) {
}

// Test an aio operation with completion delivered by a signal
// FIXME: This test is ignored on mips because of failures in qemu in CI
#[test]
#[cfg_attr(any(all(target_env = "musl", target_arch = "x86_64"), target_arch = "mips"), ignore)]
fn test_write_sigev_signal() {
let _ = SIGUSR2_MTX.lock().expect("Mutex got poisoned by another test");
let sa = SigAction::new(SigHandler::Handler(sigfunc),
Expand Down Expand Up @@ -274,6 +285,7 @@ fn test_write_sigev_signal() {
// lio_listio returns.
#[test]
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)]
fn test_lio_listio_wait() {
const INITIAL: &'static [u8] = b"abcdef123456";
const WBUF: &'static [u8] = b"CDEF";
Expand Down Expand Up @@ -316,6 +328,7 @@ fn test_lio_listio_wait() {
// mechanism to check for the individual AioCb's completion.
#[test]
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)]
fn test_lio_listio_nowait() {
const INITIAL: &'static [u8] = b"abcdef123456";
const WBUF: &'static [u8] = b"CDEF";
Expand Down Expand Up @@ -358,8 +371,10 @@ fn test_lio_listio_nowait() {

// Test lio_listio with LIO_NOWAIT and a SigEvent to indicate when all AioCb's
// are complete.
// FIXME: This test is ignored on mips because of failures in qemu in CI.
#[test]
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
#[cfg_attr(any(target_arch = "mips", target_env = "musl"), ignore)]
fn test_lio_listio_signal() {
let _ = SIGUSR2_MTX.lock().expect("Mutex got poisoned by another test");
const INITIAL: &'static [u8] = b"abcdef123456";
Expand Down Expand Up @@ -410,9 +425,11 @@ fn test_lio_listio_signal() {
}

// Try to use lio_listio to read into an immutable buffer. It should fail
// FIXME: This test fails to panic on Linux/musl
#[test]
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
#[should_panic(expected = "Can't read into an immutable buffer")]
#[cfg_attr(target_env = "musl", ignore)]
fn test_lio_listio_read_immutable() {
let rbuf: &'static [u8] = b"abcd";
let f = tempfile().unwrap();
Expand All @@ -430,6 +447,7 @@ fn test_lio_listio_read_immutable() {
// Test dropping an AioCb that hasn't yet finished. Behind the scenes, the
// library should wait for the AioCb's completion.
#[test]
#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)]
fn test_drop() {
const INITIAL: &'static [u8] = b"abcdef123456";
const WBUF: &'static [u8] = b"CDEF"; //"CDEF".to_string().into_bytes();
Expand Down
7 changes: 7 additions & 0 deletions test/sys/test_select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,14 @@ fn test_fdset() {
}
}

// powerpc-unknown-linux-gnu currently fails on the first `assert_eq` because
// `select()` returns a 0 instead of a 1. Since this test has only been run on
// qemu, it's unclear if this is a OS or qemu bug. Just disable it on that arch
// for now.
// FIXME: Fix tests for powerpc and mips
// FIXME: Add a link to an upstream qemu bug if there is one
#[test]
#[cfg_attr(any(target_arch = "powerpc", target_arch = "mips"), ignore)]
fn test_select() {
let (r1, w1) = pipe().unwrap();
write(w1, b"hi!").unwrap();
Expand Down
4 changes: 4 additions & 0 deletions test/test_mq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ fn test_mq_getattr() {
mq_close(mqd).unwrap();
}

// FIXME: Fix failures for mips in QEMU
#[test]
#[cfg_attr(target_arch = "mips", ignore)]
fn test_mq_setattr() {
const MSG_SIZE: c_long = 32;
let initial_attr = MqAttr::new(0, 10, MSG_SIZE, 0);
Expand All @@ -93,7 +95,9 @@ fn test_mq_setattr() {
mq_close(mqd).unwrap();
}

// FIXME: Fix failures for mips in QEMU
#[test]
#[cfg_attr(target_arch = "mips", ignore)]
fn test_mq_set_nonblocking() {
const MSG_SIZE: c_long = 32;
let initial_attr = MqAttr::new(0, 10, MSG_SIZE, 0);
Expand Down