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

[SR-1135] swift test should always build #5307

Closed
ddunbar opened this issue Apr 3, 2016 · 5 comments
Closed

[SR-1135] swift test should always build #5307

ddunbar opened this issue Apr 3, 2016 · 5 comments
Assignees
Labels

Comments

@ddunbar
Copy link
Member

ddunbar commented Apr 3, 2016

Previous ID SR-1135
Radar None
Original Reporter @ddunbar
Type Bug
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 1
Component/s Package Manager
Labels Bug
Assignee @ddunbar
Priority Medium

md5: d7e2e4af49ddd7ba3c432daff4bae247

Issue Description:

Sometimes `swift test` doesn't build, e.g. if there is no .build directory it reports:

$ swift test
error: build the package using `swift build` before running tests

I think that we should try and have building be as much an "implementation detail" as possible, and try and always perform actions which are "consistent" in the sense that they match the state of the source. Of course, it is fine to support options to override this behavior, but I think it is the best default.

My goals are that we can work hard on the build system to try and ensure it is efficient enough that this is a good default for almost all situations.

@ddunbar
Copy link
Member Author

ddunbar commented Apr 3, 2016

CC @mxcl

@ddunbar
Copy link
Member Author

ddunbar commented Apr 3, 2016

This leads to some very confusing behavior currently. For example, if you have no tests in Tests/, but you have built, then running `swift test` complains:

$ swift test
error: no tests found to execute, create a test-module in `Tests` directory

Even though the tests actually are present.

@mxcl
Copy link
Contributor

mxcl commented Apr 3, 2016

We can improve the error handling so it is clearer.

The rationale for not building is that people want control, this way they have control. If they absolutely do not want to trigger a build, this allows it.

Though we certainly can make it the default to build, and add a flag, and I tend to agree this should be the default, I'm just not 100% sure.

@ddunbar
Copy link
Member Author

ddunbar commented Jul 14, 2016

PR: #494

@ddunbar
Copy link
Member Author

ddunbar commented Jul 28, 2016

Merged.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants