Skip to content

Remove special handling of _SWIFTPM_SKIP_TESTS_LIST environment variables #8533

Open
@bkhouri

Description

@bkhouri

Is it reproducible with SwiftPM command-line tools: swift build, swift test, swift package etc?

  • Confirmed reproduction steps with SwiftPM CLI. The description text must include reproduction steps with either of command-line SwiftPM commands, swift build, swift test, swift package etc.

Description

When using environment variables, it can cause builds to no longer be repeatable. As such, SwiftPM should aim to remove handling of environment variables into proper features, whether it's through command line options, or via a Package.swift API change.

SwiftPM has a specific environment variable _SWIFTPM_SKIP_TESTS_LIST, that when set, "magically" filters the set of tests to execute.

The Swift PM test runner command currently have a --skip <tests> command line option, which appears to be a suitable replacement.

  --skip <skip>           Skip test cases matching regular expression, Example: --skip PerformanceTests

We should compare the --skip and the _SWIFTPM_SKIP_TESTS_LIST functionality.

  • if they are the same, we should create a transition plan to deperecate/remove the _SWIFTPM_SKIP_TESTS_LIST in favour of --skip
  • if they are not the same, we come up with a plan to desecrate the _SWIFTPM_SKIP_TESTS_LIST in favour of an more deterministic, and hermetic, way.

Expected behavior

N/A

Actual behavior

N.A

Steps to reproduce

N/A

Swift Package Manager version/commit hash

N/A

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

❯ uname -a
Darwin BKs-Work-M1Pro-MacBook-Pro-3.local 24.5.0 Darwin Kernel Version 24.5.0: Sun Apr 13 22:01:22 PDT 2025; root:xnu_development-11417.120.105.0.2~26/DEVELOPMENT_ARM64_T6000 arm64

❯ swift --version
Apple Swift version 6.1 (swift-6.1-RELEASE)
Target: arm64-apple-macosx15.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions