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: Compute coverage over all tests #2525

Closed
wants to merge 5 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
5 changes: 5 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
coverage:
status:
project: default
patch:
default: false
14 changes: 6 additions & 8 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,16 @@ jobs:
container:
image: docker://ghcr.io/linkerd/dev:v42-rust
options: --security-opt seccomp=unconfined # 🤷
env:
CXX: "/usr/bin/clang++-14"
steps:
# XXX(ver) Workaround for a linking problem in the binary we store in the
# devcontainer.
- run: rm -f /usr/local/bin/cargo-tarpaulin && cargo install cargo-tarpaulin
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
# XXX(ver) AFAICT, Tarpaulin doesn't allow us to compose a report over multiple invocations,
# so we have to choose between getting coverage from unit tests and integration tests (since
# integration tests require --no-default-features to avoid flakiness). Currently the
# integration tests seem to cover more code, so we skip the unit tests for now :(.
#- run: cargo tarpaulin --locked --workspace --exclude=linkerd2-proxy --exclude=linkerd-app-integration --no-run
#- run: cargo tarpaulin --locked --workspace --exclude=linkerd2-proxy --exclude=linkerd-app-integration --skip-clean --ignore-tests --no-fail-fast --out=Xml
- run: cargo tarpaulin --locked --packages=linkerd-app-integration --no-default-features --skip-clean --no-run
- run: cargo tarpaulin --locked --packages=linkerd-app-integration --no-default-features --skip-clean --ignore-tests --no-fail-fast --out=Xml
- run: cargo tarpaulin --locked --workspace --exclude=linkerd2-proxy --no-run
- run: cargo tarpaulin --locked --workspace --exclude=linkerd2-proxy --skip-clean --ignore-tests --no-fail-fast --out=Xml
# Some tests are especially flakey in coverage tests. That's fine. We
# only really care to measure how much of our codebase is covered.
continue-on-error: true
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
9 changes: 3 additions & 6 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ jobs:
--package=linkerd-app-inbound \
--package=linkerd-app-outbound \
--package=linkerd-app-test
- run: |
just test-crate linkerd-app-integration --no-run \
--no-default-features --features=flakey-in-coverage
- run: |
just test-crate linkerd-app-integration \
--no-default-features --features=flakey-in-coverage
- run: just test-crate linkerd-app-integration --no-default-features --no-run
- run: just test-crate linkerd-app-integration --no-default-features

5 changes: 2 additions & 3 deletions linkerd/app/integration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ a dedicated crate to help the compiler cache dependencies properly.
"""

[features]
default = ["flakey-in-ci"]
flakey-in-ci = ["flakey-in-coverage"]
flakey-in-coverage = []
default = []
flakey = []

[dependencies]
bytes = "1"
Expand Down
6 changes: 2 additions & 4 deletions linkerd/app/integration/src/tests/telemetry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ where
// Eventually, we can add some kind of mock timer system for simulating latency
// more reliably, and re-enable this test.
#[tokio::test]
#[cfg_attr(not(feature = "flakey-in-ci"), ignore)]
#[cfg_attr(not(feature = "flakey"), ignore)]
async fn inbound_response_latency() {
test_response_latency(Fixture::inbound_with_server).await
}
Expand All @@ -518,7 +518,7 @@ async fn inbound_response_latency() {
// Eventually, we can add some kind of mock timer system for simulating latency
// more reliably, and re-enable this test.
#[tokio::test]
#[cfg_attr(not(feature = "flakey-in-ci"), ignore)]
#[cfg_attr(not(feature = "flakey"), ignore)]
async fn outbound_response_latency() {
test_response_latency(Fixture::outbound_with_server).await
}
Expand Down Expand Up @@ -1203,7 +1203,6 @@ mod transport {
test_tcp_connect(TcpFixture::outbound()).await;
}

#[cfg_attr(not(feature = "flakey-in-coverage"), ignore)]
#[tokio::test]
async fn outbound_tcp_accept() {
test_tcp_accept(TcpFixture::outbound()).await;
Expand All @@ -1229,7 +1228,6 @@ mod transport {
test_read_bytes_total(TcpFixture::outbound()).await
}

#[cfg_attr(not(feature = "flakey-in-coverage"), ignore)]
#[tokio::test]
async fn outbound_tcp_open_connections() {
test_tcp_open_conns(TcpFixture::outbound()).await
Expand Down
2 changes: 0 additions & 2 deletions linkerd/app/integration/src/tests/telemetry/tcp_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ async fn inbound_multi() {
}

/// Tests that TLS detect failure metrics are collected for the direct stack.
#[cfg_attr(not(feature = "flakey-in-coverage"), ignore)]
#[tokio::test]
async fn inbound_direct_multi() {
let _trace = trace_init();
Expand Down Expand Up @@ -315,7 +314,6 @@ async fn inbound_invalid_ip() {

/// Tests that the detect metric is not incremented when TLS is successfully
/// detected by the direct stack.
#[cfg_attr(not(feature = "flakey-in-coverage"), ignore)]
#[tokio::test]
async fn inbound_direct_success() {
let _trace = trace_init();
Expand Down
Loading