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

Stop compiling and testing packages in testdata #488

Merged
merged 1 commit into from
Apr 27, 2021

Conversation

CtrlZvi
Copy link

@CtrlZvi CtrlZvi commented Jun 9, 2017

Go tooling, including go test treat the testdata directory as an opaque
directory containing data for tests. Unfortunately, goconvey would treat go
source files inside testdata or its subdirectories as creating a package,
causing divergence in behavior from Go tooling.

This commit causes goconvey to not treat anything inside the testdata
directory or subdirectories as a package without removing them from the watch
list. This creates behavioral parity with Go tooling, but means a change in
testdata will still cause tests to be rerun.

hasImportCycle := testFilesImportTheirOwnPackage(folder.Path)
packageList = append(packageList, contract.NewPackage(folder, hasImportCycle))
}
return packageList
}

func isInsideTestdata(folder *messaging.Folder) bool {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we add a comment to this function explaining the situation?

Copy link
Collaborator

@riannucci riannucci left a comment

Choose a reason for hiding this comment

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

This looks good to me with the additional docstring

Go tooling, including `go test` treat the testdata directory as an opaque
directory containing data for tests. Unfortunately, goconvey would treat go
source files inside testdata or its subdirectories as creating a package,
causing divergence in behavior from Go tooling.

This commit causes goconvey to not treat anything inside the testdata
directory or subdirectories as a package without removing them from the watch
list. This creates behavioral parity with Go tooling, but means a change in
testdata will still cause tests to be rerun.
@riannucci riannucci merged commit 0fc5ef5 into smartystreets:master Apr 27, 2021
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.

2 participants