Skip to content

chore: check each feature works properly #1695

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

Merged
merged 18 commits into from
Nov 1, 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
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ members = [

# Internal
"examples",
"tests-build",
"tests-integration",
]
43 changes: 6 additions & 37 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,8 @@ jobs:
displayName: Test tokio
cross: true
crates:
tokio:
- fs
- io
- io-util
- net-driver
- process
- rt-full
- signal
- sync
- tcp
- timer
- udp
- uds
tests-integration: []
- tokio
- tests-integration

# Test crates that are NOT platform specific
- template: ci/azure-test-stable.yml
Expand All @@ -47,29 +35,10 @@ jobs:
displayName: Test sub crates -
rust: beta
crates:
tokio-macros: []
tokio-test: []
tokio-util: []
examples: []

# Test compilation failure
# Disable pending: https://github.com/tokio-rs/tokio/pull/1695#issuecomment-547045383
Copy link
Member Author

Choose a reason for hiding this comment

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

Removed :)

# - template: ci/azure-test-stable.yml
# parameters:
# name: test_features
# displayName: Test feature flags
# rust: beta
# crates:
# tests-build:
# # - tokio-executor
# # - executor-without-current-thread
# # - macros-invalid-input
# # - net-no-features
# # - net-with-tcp
# # - net-with-udp
# # - net-with-uds
# # - tokio-no-features
# # - tokio-with-net
- tokio-macros
- tokio-test
- tokio-util
- examples

# Run loom tests
- template: ci/azure-loom.yml
Expand Down
71 changes: 49 additions & 22 deletions ci/azure-test-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ jobs:
# rust_version: stable
rust_version: ${{ parameters.rust }}

- script: cargo install cargo-hack
Copy link
Member

Choose a reason for hiding this comment

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

This is nitpicky, but it might be helpful to have a comment here explaining what we're using cargo-hack for and why?

Copy link
Member Author

Choose a reason for hiding this comment

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

I wrote descriptions for 'check' scripts, but if necessary, I'd happy to add a description to the 'install' script.

# Check each specified feature works properly
# * --each-feature - run for each feature which includes --no-default-features and default features of package
# * --no-dev-deps - build without dev-dependencies to avoid https://github.com/rust-lang/cargo/issues/4866
- script: cargo hack check --each-feature --no-dev-deps

# Check each specified feature works properly
# * --each-feature - run for each feature which includes --no-default-features and default features of package
# * --no-dev-deps - build without dev-dependencies to avoid https://github.com/rust-lang/cargo/issues/4866
- script: cargo hack check --each-feature --no-dev-deps

displayName: Install cargo-hack
# FIXME(taiki-e): many features of current cargo-hack are not available on windows: https://github.com/taiki-e/cargo-hack/issues/3
condition: not(eq(variables['Agent.OS'], 'Windows_NT'))

- template: azure-is-release.yml

- ${{ each crate in parameters.crates }}:
Expand All @@ -28,17 +33,28 @@ jobs:
env:
LOOM_MAX_PREEMPTIONS: 2
CI: 'True'
displayName: ${{ crate.key }} - cargo test
workingDirectory: $(Build.SourcesDirectory)/${{ crate.key }}

# Run with each specified feature
- ${{ each feature in crate.value }}:
- script: cargo test --no-default-features --features ${{ feature }}
env:
LOOM_MAX_PREEMPTIONS: 2
CI: 'True'
displayName: ${{ crate.key }} - cargo test --features ${{ feature }}
workingDirectory: $(Build.SourcesDirectory)/${{ crate.key }}
displayName: ${{ crate }} - cargo test
workingDirectory: $(Build.SourcesDirectory)/${{ crate }}

# Run with all crate features
- script: cargo test --all-features
env:
LOOM_MAX_PREEMPTIONS: 2
CI: 'True'
displayName: ${{ crate }} - cargo test --all-features
workingDirectory: $(Build.SourcesDirectory)/${{ crate }}

# Check each specified feature works properly
# * --each-feature - run for each feature which includes --no-default-features and default features of package
# * --no-dev-deps - build without dev-dependencies to avoid https://github.com/rust-lang/cargo/issues/4866
- script: cargo hack check --each-feature --no-dev-deps
env:
LOOM_MAX_PREEMPTIONS: 2
CI: 'True'
displayName: ${{ crate }} - cargo hack check --each-feature
workingDirectory: $(Build.SourcesDirectory)/${{ crate }}
# FIXME(taiki-e): many features of current cargo-hack are not available on windows: https://github.com/taiki-e/cargo-hack/issues/3
condition: not(eq(variables['Agent.OS'], 'Windows_NT'))

- template: azure-patch-crates.yml

Expand All @@ -48,14 +64,25 @@ jobs:
env:
LOOM_MAX_PREEMPTIONS: 2
CI: 'True'
displayName: ${{ crate.key }} - cargo test
workingDirectory: $(Build.SourcesDirectory)/${{ crate.key }}

# Run with each specified feature
- ${{ each feature in crate.value }}:
- script: cargo test --no-default-features --features ${{ feature }}
env:
LOOM_MAX_PREEMPTIONS: 2
CI: 'True'
displayName: ${{ crate.key }} - cargo test --features ${{ feature }}
workingDirectory: $(Build.SourcesDirectory)/${{ crate.key }}
displayName: ${{ crate }} - cargo test
workingDirectory: $(Build.SourcesDirectory)/${{ crate }}

# Run with all crate features
- script: cargo test --all-features
env:
LOOM_MAX_PREEMPTIONS: 2
CI: 'True'
displayName: ${{ crate }} - cargo test --all-features
workingDirectory: $(Build.SourcesDirectory)/${{ crate }}

# Check each specified feature works properly
# * --each-feature - run for each feature which includes --no-default-features and default features of package
# * --no-dev-deps - build without dev-dependencies to avoid https://github.com/rust-lang/cargo/issues/4866
- script: cargo hack check --each-feature --no-dev-deps
env:
LOOM_MAX_PREEMPTIONS: 2
CI: 'True'
displayName: ${{ crate }} - cargo hack check --each-feature
workingDirectory: $(Build.SourcesDirectory)/${{ crate }}
# FIXME(taiki-e): many features of current cargo-hack are not available on windows: https://github.com/taiki-e/cargo-hack/issues/3
condition: not(eq(variables['Agent.OS'], 'Windows_NT'))
Copy link
Member Author

Choose a reason for hiding this comment

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

Unfortunately, many features of current cargo-hack are not available on windows. (taiki-e/cargo-hack#3)

Copy link
Member Author

Choose a reason for hiding this comment

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

However, it seems many features are not directly related to OS-specific dependencies (7aee1f8), so for now, I think this is almost all right.

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried to fix this in taiki-e/cargo-hack#6, but I couldn't fix it completely.

25 changes: 0 additions & 25 deletions tests-build/Cargo.toml

This file was deleted.

2 changes: 0 additions & 2 deletions tests-build/README.md

This file was deleted.

8 changes: 0 additions & 8 deletions tests-build/src/lib.rs

This file was deleted.

3 changes: 0 additions & 3 deletions tests-build/tests/fail/executor_without_current_thread.rs

This file was deleted.

7 changes: 0 additions & 7 deletions tests-build/tests/fail/executor_without_current_thread.stderr

This file was deleted.

25 changes: 0 additions & 25 deletions tests-build/tests/fail/macros_invalid_input.rs

This file was deleted.

41 changes: 0 additions & 41 deletions tests-build/tests/fail/macros_invalid_input.stderr

This file was deleted.

4 changes: 0 additions & 4 deletions tests-build/tests/fail/net_without_tcp_missing_tcp.rs

This file was deleted.

7 changes: 0 additions & 7 deletions tests-build/tests/fail/net_without_tcp_missing_tcp.stderr

This file was deleted.

4 changes: 0 additions & 4 deletions tests-build/tests/fail/net_without_udp_missing_udp.rs

This file was deleted.

7 changes: 0 additions & 7 deletions tests-build/tests/fail/net_without_udp_missing_udp.stderr

This file was deleted.

4 changes: 0 additions & 4 deletions tests-build/tests/fail/net_without_uds_missing_uds.rs

This file was deleted.

7 changes: 0 additions & 7 deletions tests-build/tests/fail/net_without_uds_missing_uds.stderr

This file was deleted.

3 changes: 0 additions & 3 deletions tests-build/tests/fail/tokio_without_net_missing_net.rs

This file was deleted.

7 changes: 0 additions & 7 deletions tests-build/tests/fail/tokio_without_net_missing_net.stderr

This file was deleted.

62 changes: 0 additions & 62 deletions tests-build/tests/features.rs

This file was deleted.

Loading