-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
build: allow directories for acceptance tests #19321
Conversation
9c677b0
to
ec04ccd
Compare
🎉 this is such an improvement. I didn't review the actual Java, FYI. Reviewed 20 of 20 files at r1. pkg/acceptance/java_test.go, line 31 at r1 (raw file):
(I mentioned this below, but I'd be a very happy camper if these were instead baked into the postgres-test image at the appropriate classpath.) pkg/acceptance/java_test.go, line 42 at r1 (raw file):
I recommend dropping this test; every Docker test is so slow + flaky that we want each one to count. pkg/acceptance/util_docker.go, line 51 at r1 (raw file):
I would drop this from the struct, and just always bind pkg/acceptance/util_docker.go, line 99 at r1 (raw file):
eek! return also why predeclare pkg/acceptance/java_test/.gitignore, line 5 at r1 (raw file):
On principle, we don't store os- or editor-specific entries in our .gitignores. (See one of the other .gitignores for rationale.) That means .DS_Store and .idea should go, but *.class and target should stay. Is key.pk8 necessary to ignore, or just part of an auto-generated .gitignore? pkg/acceptance/java_test/lib/hamcrest.jar, line 0 at r1 (raw file): pkg/acceptance/java_test/src/main/java/main.java, line 1 at r1 (raw file):
Convention is to put files like this in a folder named Comments from Reviewable |
Just responded to a couple things with clarification/questions - still working on the others Review status: all files reviewed at latest revision, 7 unresolved discussions, some commit checks failed. pkg/acceptance/java_test.go, line 42 at r1 (raw file): Previously, benesch (Nikhil Benesch) wrote…
We actually have a bunch of tests like this that mess with their input to intentionally fail (I think Tamir told me it's because there was a time when they were failing but we weren't detecting said failures appropriately). Perhaps we could even get away with deleting all but one of them at this point? I think every acceptance test has two versions in this way. pkg/acceptance/util_docker.go, line 51 at r1 (raw file): Previously, benesch (Nikhil Benesch) wrote…
👍 good point, I can just get rid of this struct and go back to the old function signatures then. pkg/acceptance/util_docker.go, line 99 at r1 (raw file): Previously, benesch (Nikhil Benesch) wrote…
The structure of this function is odd, the entire function predeclares pkg/acceptance/java_test/.gitignore, line 5 at r1 (raw file): Previously, benesch (Nikhil Benesch) wrote…
I'll remove the other stuff, I sort of feel like pkg/acceptance/java_test/lib/hamcrest.jar, line at r1 (raw file): Previously, benesch (Nikhil Benesch) wrote…
It's nicer to work with them in an IDE if the IDE has access to them for autocomplete and stuff (which is why I put them in here), but I agree that their inclusion is unfortunate, I wonder if there's a way to get IntelliJ to download them and put them in an ignored directory... I'll look into that. Would it be [overly] weird to Comments from Reviewable |
Review status: all files reviewed at latest revision, 7 unresolved discussions, some commit checks failed. pkg/acceptance/java_test.go, line 42 at r1 (raw file): Previously, justinj (Justin Jaffray) wrote…
Heh, you're totally right. I'm not sold on this being useful, but no point in breaking with convention. pkg/acceptance/util_docker.go, line 51 at r1 (raw file): Previously, justinj (Justin Jaffray) wrote…
👍 pkg/acceptance/util_docker.go, line 99 at r1 (raw file): Previously, justinj (Justin Jaffray) wrote…
Oh, wow, I entirely misread. Carry on. Seems fine enough. pkg/acceptance/java_test/.gitignore, line 5 at r1 (raw file): Previously, justinj (Justin Jaffray) wrote…
Yeah, I know what you mean, but I have a moderately-strong preference for forcing people to put crap like that into their global gitignore. This has served me so well:
(E.g., what if someone else working on Java prefers Eclipse or NetBeans or whatever?) pkg/acceptance/java_test/lib/hamcrest.jar, line at r1 (raw file): Previously, justinj (Justin Jaffray) wrote…
Yeah, option b sounds perfect. I'd ignore all JAR files or Comments from Reviewable |
Review status: all files reviewed at latest revision, 7 unresolved discussions, some commit checks failed. pkg/acceptance/java_test/.gitignore, line 5 at r1 (raw file): Previously, benesch (Nikhil Benesch) wrote…
-1 on including any intellij stuff in here at all. just use pom.xml. intellij (and every java ide) can import those Comments from Reviewable |
+1 on the approach, looking good! Reviewed 20 of 20 files at r1. Comments from Reviewable |
ec04ccd
to
ac3697a
Compare
ac3697a
to
f41a9c9
Compare
Review status: 0 of 8 files reviewed at latest revision, 7 unresolved discussions, some commit checks pending. pkg/acceptance/java_test.go, line 31 at r1 (raw file): Previously, benesch (Nikhil Benesch) wrote…
pkg/acceptance/util_docker.go, line 51 at r1 (raw file): Previously, benesch (Nikhil Benesch) wrote…
Done. pkg/acceptance/java_test/lib/hamcrest.jar, line at r1 (raw file): Previously, benesch (Nikhil Benesch) wrote…
Ok, pkg/acceptance/java_test/.gitignore, line 5 at r1 (raw file): Previously, jordanlewis (Jordan Lewis) wrote…
Done. Comments from Reviewable |
I'm pretty convinced that you should just make Review status: 0 of 8 files reviewed at latest revision, 10 unresolved discussions, some commit checks pending. pkg/acceptance/java_test.go, line 44 at r2 (raw file):
yay. fwiw this is kind of weird - normally you'd just run pkg/acceptance/testdata/java/java.iml, line 2 at r2 (raw file):
this is an intellj file right? kill it with 🔥 :) pkg/acceptance/testdata/java/pom.xml, line 25 at r2 (raw file):
sweet! like i said above you can set this up so that Comments from Reviewable |
Does this close #4591? |
0694ee6
to
67dbdd5
Compare
It does, thanks for the heads up @tamird. @jordanlewis good call, I didn't realize we would be able to do that - it uses |
67dbdd5
to
7703963
Compare
Reviewed 6 of 27 files at r2, 6 of 6 files at r3. pkg/acceptance/java_test.go, line 41 at r3 (raw file):
👍 this is short and sweet. Nice! Comments from Reviewable |
I think you just need to tag and push your postgres-test image and update util_docker.go accordingly in this PR? |
BTW, re: the negative tests -- I think it's good not to have rot there, but it's not worth the CI time in the "hot path". I don't think I would trust a separate "sentinel test", but we could just run the negatives nightly-only and would find out pretty quickly if something did regress. |
Closes cockroachdb#4591. 🔬🐶, this commit lets acceptance tests specify a directory which should be mounted. Included is a test of jdbc which translates the old string literal test into one which has a directory structure and can be opened in IntelliJ.
7703963
to
a7a5a57
Compare
Thanks for the reviews! |
🔬🐶, this commit lets acceptance tests specify a directory which should
be mounted.
Included is a test of jdbc which translates the old string literal test
into one which has a directory structure and can be opened in IntelliJ.
@jordanlewis could you also check that you can open the
java_test
directory in IntelliJ and have it load properly and stuff (you still have to usemake acceptance TESTS=TestDockerJava
to run it)?