Selaa lähdekoodia

Fix build error for `make test-unit`

This fix tries to address the issue raised by #33856 where
`make test-unit` will result in the failure:
```
...
...
dockerversion/useragent.go:20: undefined: Version
dockerversion/useragent.go:22: undefined: GitCommit
ok  	github.com/docker/docker/api	0.026s	coverage: 68.0% of statements
ok  	github.com/docker/docker/api/errors	0.003s	coverage: 100.0% of statements
FAIL	github.com/docker/docker/api/server [build failed]
make: *** [test-unit] Error 2
```

The issue is because in case of `make test-unit`, `source "${MAKEDIR}/.go-autogen"`
is missing.

This caused the `make test-unit` failure.

This fix adds `source "${MAKEDIR}/.go-autogen"` in `hack/make/test-unit`

This fix fixes #33856.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Yong Tang 8 vuotta sitten
vanhempi
commit
fac486d0a0
1 muutettua tiedostoa jossa 2 lisäystä ja 0 poistoa
  1. 2 0
      hack/make/test-unit

+ 2 - 0
hack/make/test-unit

@@ -26,6 +26,8 @@ bundle_test_unit() {
 		TEST_PATH=./${TESTDIRS}
 	fi
 
+	source "${MAKEDIR}/.go-autogen"
+
 	if [ "$(go env GOHOSTOS)" = 'solaris' ]; then
 		pkg_list=$(go list -e \
 			-f '{{if ne .Name "github.com/docker/docker"}}