-
Notifications
You must be signed in to change notification settings - Fork 1k
Parallel capability for integration tests #378
Conversation
Hmm - Travis is giving errors, where my machine shows all passes. Makes me wonder if there is a platform dependence to Cmd.Dir, or other exec dependence in the way. If so, the architecture to get to parallel capability is not robust. I'll dig, but we may have to pull the plug on this one. |
Well, the Linux builds are only failing In either case, maybe worth revisiting when the new gps shows up. |
@sdboyer - when do you plan to merge the new gps into dep? I will retry then to see if the platform dependency drops. |
@tro3 I'll probably do another merge this weekend. Once I do, I'll loop back here and look at the mac failures as well. |
@sdboyer - I may be on to a subtle issue on my end, so the jury is still out. Let's each work our angles and meet on the other side. :-) |
Okay - the Linux failures were my fault, and those are now fixed. So PC and Linux are now clean. The Mac failures I cannot yet speak to, but will now try to find a pattern in the failing tests. |
Well, the pattern on Macs is pretty simple - dep (or git?) is not running. The only test that passes is Hope this helps, but we're likely at the end of what I can do. |
BTW, when the new |
@tro3 new gps is in - any chance you have time to poke at this a bit more before you drop off on Monday? 🙏 🙏 🙏 (also, we'll miss you!) |
Okay - as one would expect, the Linux and PC platforms work in the new GPS, but the Mac version of the test is DOA. If you have any suggestions as to what the Mac issue might be, I am happy to try them out. In the interim, I'll submit a separate "enable the remove tests on Windows" PR just to make sure that gets in. |
Oh - and the parallel tests now work on PC. So I've uncommented to see if they are running on Linux as well. Still doubt Mac will fly. |
8d8a8c6
to
1050f75
Compare
This PR needs help from someone developing on a Mac. The architecture was simply to move from a "cd to projectDir and run command" to a "remain in test workingDir and launch command shell in projectDir" methodology. The "cd" operation was leaking across threads, preventing parallelism. Something about the above does not work on a Mac. PC and Linux are ok and test times do indeed drop in half, but the Mac tests die with exit status 1 in every test. I've tried removing the trailing slash in If someone with a Mac can dig deeper, I'm happy to incorporate any changes and help get this off the ground. |
test/integration_testproj.go
Outdated
new.h.Setenv("GOPATH", new.h.Path(".")) | ||
new.h.Cd(new.Path(ProjectRoot)) | ||
if runtime.GOOS == "darwin" { | ||
new.Setenv("GOPATH", filepath.Join("/private", new.tempdir)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OHHHH THE STUPID /private
LEADER
Yeah, that's one of those things that bites me, I curse at my mac for a while, then I promptly forget about. Sorry - that must've been a giant pain to track down through runs against a slow CI system 😦
I think we may get a bit more portability if you first check that the first element of new.tempdir
is /tmp
. Other than that, though, this strikes me as a sane way of compensating for this problem, at least for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, this is a known thing? My first time running across it. The /tmp
is dicey, as they are not /tmp
in Windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's a thing - idk why, but in Apple's (bsd's?) infinite wisdom, they decided it's a good idea for /var
, /etc
, and /tmp
to be symlinks to that respective name under a /private
dir. Maybe it's a permissioning thing.
So, right - I meant, only do that extra check if we're on darwin
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, will add along with documentation
Success!! Okay, on Travis with the darwin mac platform, commands are run in a dir structure that adds "/private" in front. So all tests run with a remote dir launch were dying because they did not appear to be in a GOPATH. I've added a patch that adds "/private" to the environment GOPATH for darwin tests. I will now add documentation in the code. Man, that is not the way to debug - created a new branch, limited the Travis tests to darwin, and add test logging and tweaks to read the output through the website. Not recommended. :-) |
@sdboyer ready for review. Will try to turn around any feedback tonight. |
Looks good! Thanks for sticking with this one! |
Parallel capability for integration tests
Going after #362.
Adds parallel capability by removing all "cd" commands from the test, running the entire test from one working directory. The directory creation and process-launching functions from TestHelper are not used, with constant-working-directory versions moved into TestProject. (Some dependency on TestHelper remains, and one could make an aurgument that this should be cleaned up.)