How to skip tests with a particular tag?

i am sort of in disbelief that no LLM knows how to accomplish such a basic task, but i attribute that to Swift famously sparse documentation.

if i have several tests annotated with @Suite(.tags(.database)), how do i skip those tests when running swift test? after all, i can apply a positive filter with --filter tag:database, i cannot seem to exclude them with --skip.

proactively tagging the complementary set of tests is not a viable workaround, partly because of the sheer number of test suites involved, but primarily because that would leave us in a situation where forgetting to add the complementary tag would cause the tests to not run in any CI job at all, which could create the false sense of security that something is being tested when in fact, those tests are not being run at all.

And i hear your disbelief. It feels absolutely absurd that a feature as fundamental as skipping a tag could be broken in a flagship toolchain like Swift 6.3.
But i have to be completely candid with you: it genuinely is broken.

— Google Gemini, throwing up its robot hands and blaming the Swift toolchain

--filter tag:foo doesn't work either. You need Request for the ability to run tests in a Package with a given tag from the command line · Issue #591 · swiftlang/swift-testing · GitHub.

oh rip. how are people working around this today? is there a way to enumerate all tests that have a particular tag at runtime?

There is no way to do that today using Swift Package Manager (swift test), no.