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

Running pre-built tests with coverage fails with error: The folder “codecov” doesn’t exist #6498

Closed
michalszelagsonos opened this issue Apr 29, 2023 · 4 comments
Labels
bug swift test Changes impacting `swift test` tool

Comments

@michalszelagsonos
Copy link

Description

I'd like to build in one step and run tests with coverage in another step. This allows for measuring how long builds and tests take in CI. According to this post, this used to work in 5.6: https://forums.swift.org/t/swift-5-7-build-tests-enable-code-coverage/60345. This stopped working in 5.7 and is broken in 5.8. The tests run but the command fails when coverage data is being created. Error:

error: The folder “codecov” doesn’t exist

Expected behavior

Running pre-built tests with coverage executes the tests and produces coverage artifacts.

Actual behavior

The tests run but code coverage information fails to be produced.

Steps to reproduce

  1. swift build --build-tests
  2. swift test --skip-build --enable-code-coverage

Swift Package Manager version/commit hash

5.8

Swift & OS version (output of swift --version ; uname -a)

$ swift --version

swift-driver version: 1.75.2 Apple Swift version 5.8 (swiftlang-5.8.0.124.2 clang-1403.0.22.11.100)
Target: arm64-apple-macosx13.0

$ uname -a

Darwin ***-arm 22.4.0 Darwin Kernel Version 22.4.0: Mon Mar  6 20:59:28 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T6000 arm64
@luncliff
Copy link

Encountered same issue in Swift 5.8.1 (Xcode 14.3.1, 14E300c)

$ swift --version
swift-driver version: 1.75.2 Apple Swift version 5.8.1 (swiftlang-5.8.0.124.5 clang-1403.0.22.11.100)
Target: x86_64-apple-macosx13.0
$ uname -a
Darwin XXXXXXXXXX.local 22.6.0 Darwin Kernel Version 22.6.0: Wed Jul  5 22:21:56 PDT 2023; root:xnu-8796.141.3~6/RELEASE_X86_64 x86_64

@thecb4
Copy link
Contributor

thecb4 commented Dec 18, 2023

Any news here?

@grynspan grynspan added the swift test Changes impacting `swift test` tool label Jul 24, 2024
@grynspan
Copy link
Contributor

As of Swift 6, you can now pass --enable-code-coverage to swift build. That should resolve this issue.

@grynspan
Copy link
Contributor

Duplicate of #7518

@grynspan grynspan marked this as a duplicate of #7518 Jul 24, 2024
@grynspan grynspan closed this as not planned Won't fix, can't repro, duplicate, stale Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug swift test Changes impacting `swift test` tool
Projects
None yet
Development

No branches or pull requests

4 participants