Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Ubuntu 21.04] Fix test failures in bats tests due to Go 1.16 choosin…
…g Go Modules instead of GOPATH by default * After a system upgrade from `Ubuntu 20.10` to `Ubuntu 21.04`, we noticed an in-house system started failing bats tests that used the `go` utility. An example failure symptom is the following. ```sh $ bats --tap -f TPGC001 bats_tests/test_psql_go_connection.bats 1..1 not ok 1 TPGC001 : fetch column data types . . # > go get: malformed module path "get_column_information": missing dot in first path element ``` * Thanks to golang/go#35048 (comment), I found the issue and workaround. I made a change to do the following before the `go get` that is done in the `run_go()` framework function in `tests/test_helpers.bash.in` and `go` related bats tests started working fine then on. ```sh export GO111MODULE=off ``` * https://dev.to/maelvls/why-is-go111module-everywhere-and-everything-about-go-modules-24k discusses this issue in detail. Pasted below is the relevant text from there. ``` GO111MODULE with Go 1.16 ------------------------ As of Go 1.16, the default behavior is GO111MODULE=on, meaning that if you want to keep using the old GOPATH way, you will have to force Go not to use the Go Modules feature: export GO111MODULE=off ``` * This is exactly what was done at https://gitlab.com/YottaDB/DB/YDBTest/-/merge_requests/1129/diffs too. * We will need to worry about this when Go 1.17 comes out and everything starts only using `Go Modules`. But until then this workaround is good enough.
- Loading branch information