Details

    • Sub-task
    • Status: Resolved
    • P2
    • Resolution: Fixed
    • None
    • Not applicable
    • sdk-go
    • None

    Description

      This is an ex-post-facto bug documenting work that should have had it's own JIRA but didn't. The purpose of this bug is to add a more detailed summary of work that is already finished.

      This work was to be able to run the new ValidatesRunner test script on Jenkins. Normally that would have been very simple (make a jenkins task and just run it), but ended up being a challenge because of a small change from the old script: The new one calls `go test` instead of running an already compiled go binary, meaning it tries to build the code from the go workspace, which doesn't contain the vendored code that gogradle has, which means the tests fail to build. Worse, there was no precedent for using the go workspace directly on jenkins in the Go SDK yet.

      The first major task was figuring out what approach to take to fix this: I tried finding out if I could substitute a gogradle command for the existing one (this didn't work. Gogradle has no existing mechanism for adding the flags I needed, and making a custom gogradle task wasn't possible for the tests). Trying to create a custom gradle task for this outside of the gogradle plugin also didn't work, as it lost all the vendoring that gogradle was handling. The final solution was to see what Jenkins had built-in for Go. Jenkins has its own Go support, but that support also does not include vendoring as far as I could tell. The solution that was most likely to work, then, was to work around the error by creating a temporary GOPATH and copying the Go SDK being tested into it so the tests could still compile with all the appropriate vendored code.

      The second major task then was to actually write the code that would do this. This involved figuring out the internal structure of Jenkins and what code is kept between tests, shared between workers, etc. so that each time we run the tests it's done hermetically. After the research was done, the script needed to be debugged, and this was a very slow exhausting process, as it involved running the postcommit and then waiting about 10 minutes each time for everything to spin up and to eventually get to the error. Ultimately this approach worked and is what the final PR implements.

      Attachments

        Issue Links

          Activity

            People

              danoliveira Daniel Oliveira
              danoliveira Daniel Oliveira
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: