Skip to content

Conversation

@abertelrud
Copy link
Contributor

Implement SE-0129 to update the test naming conventions. Instead of
automatically and silently appending a TestSuite suffix, tests are
now expected to have a Tests suffix in the module name. Right now
we make sure there are no tests under Sources and no non-tests
under Tests, but we expect to lift that restriction in the future
to allow test support libraries etc.


/// The module's name is invalid.
case invalidName(path: String, name: String, problem: ModuleNameProblem)
enum ModuleNameProblem {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: invalidTestName / TestModuleNameError would be clearer IMO

Copy link
Contributor

Choose a reason for hiding this comment

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

on second look, this seems generic

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, this is very much a work in progress. The idea is to overhaul the errors here so that they are specific, and this is definitely something that is going to need to grow over time. I will be adding comments and trying to make these errors (and their fix-its) as specific and clear as possible, but I see the testing module naming as just one aspect of various restrictions on the module name.

@aciidgh
Copy link
Contributor

aciidgh commented Jul 27, 2016

Yay!!

} else {
modules = try maybeModules.map { path in
}
else {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a nit, but can we use } else { which is most consistent with the rest of the code and Swift?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. Old habits... I'll search for and change them.

@ddunbar
Copy link
Contributor

ddunbar commented Jul 27, 2016

Won't this PR fail because it doesn't rename our own tests?

@abertelrud
Copy link
Contributor Author

Yes, I am working on those right now. I should have labeled this PR as WIP.

@abertelrud
Copy link
Contributor Author

This is also why I haven't yet started the Swift CI test requests for it.

@abertelrud
Copy link
Contributor Author

abertelrud commented Jul 27, 2016

I kind of forgot that people would start looking at it right away (and it was my intent for people to start looking at the core changes, but it was not my intent that this PR would be thought to be "done" yet in terms of fallout). My fault for not tagging it.

@abertelrud abertelrud force-pushed the SE-0129-Test-Naming-Conventions branch from 8288cb0 to 9a88011 Compare July 28, 2016 00:30
@abertelrud
Copy link
Contributor Author

@swift-ci please test

@abertelrud
Copy link
Contributor Author

Test failures are real but unrelated to this PR; I need to update to the latest trunk.

@abertelrud
Copy link
Contributor Author

The conflicts are pervasive, especially due to the recent check-ins related to convention tests.

@abertelrud
Copy link
Contributor Author

Fixing, and will then test and merge.

automatically and silently appending a `TestSuite` suffix, tests are
now expected to have a `Tests` suffix in the module name.  Right now
we make sure there are no tests under `Sources` and no non-tests
under `Tests`, but we expect to lift that restriction in the future
to allow test support libraries etc.

This commit also updates SwiftPM's own tests to follow the new naming
conventions.
@abertelrud abertelrud force-pushed the SE-0129-Test-Naming-Conventions branch from 9a88011 to fb5f684 Compare July 28, 2016 18:47
@abertelrud
Copy link
Contributor Author

@swift-ci please test

@abertelrud
Copy link
Contributor Author

Local tests on macOS succeed.

@abertelrud
Copy link
Contributor Author

Local tests on Linux also succeed. Merging.

@abertelrud abertelrud merged commit cee3991 into swiftlang:master Jul 28, 2016
@abertelrud abertelrud deleted the SE-0129-Test-Naming-Conventions branch July 28, 2016 20:34
jdhealy added a commit to jdhealy/PrettyColors that referenced this pull request Nov 8, 2016
…le requirements.

Generate the framework target automatically and manually append any test target.

See: <swiftlang/swift-package-manager#566>.
Megal pushed a commit to Megal/Nimble that referenced this pull request Jul 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants