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

Tests in the source tree #4

Open
nielsbasjes opened this issue Jul 11, 2019 · 1 comment
Open

Tests in the source tree #4

nielsbasjes opened this issue Jul 11, 2019 · 1 comment

Comments

@nielsbasjes
Copy link

There are some test classes located under the main java source tree.
This is then 'fixed' in the build.gradle with this

// Customize source code layout
sourceSets {
    main {
        java {
            srcDirs = ['java']
            exclude 'java/com/google/zetasketch/testing/**'
        }
        proto {
            srcDirs = ['proto']
        }
    }
    test {
        java {
            srcDirs = ['java/com/google/zetasketch/testing', 'javatests']
        }
    }
}

A consequence of this very strange construct is that IntelliJ gets really confused and it no longer automatically sees the sources as sources but instead it sees one level deeper as being test sources.

Screenshot from 2019-07-11 14-23-55

Why not simply move the test classes to the place where all test classes live?

@zfraa
Copy link
Member

zfraa commented Jul 22, 2019

These classes aren't tests, but test infrastructure classes (custom truth subjects, to be more specific, see https://github.com/google/truth), and have tests themselves. Because of this, they should really live in the main java source tree.
We can look into whether there's a way to exclude them from built binaries in ways which are less confusing to IntelliJ.

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

No branches or pull requests

2 participants