Skip to content

ci: fix Go tests that internally check the version of a component

The CI job test-services-linux-debug executes the tests using CMake, including the Go tests. The command used to execute the Go tests is defined in CMakeModules/testing_go.cmake Ln14: go test ${test_source_files}. The go test command first compiles the tests and then run them. Compiling the tests needs the file common/go/src/asapo_common/version/version_lib.go to correctly define the versions of the different communication protocols and components:

package version

// Default build-time variable for library-import.
// This file is overridden on build with build-time informations.
func init(){
	version   = "100.0.wip-fix-tests, build 5100fbeef8"
	consumerProtocolVersion = "v0.6"
	producerProtocolVersion = "v0.6"
	discoveryApiVersion = "v0.1"
	authorizerApiVersion = "v0.2"
	ftsApiVersion = "v0.2"
	brokerApiVersion = "v0.6"
}

The file common/go/src/asapo_common/version/version_lib.go is generated when running CMake. So the file is generated in the CI job build-services-linux-debug, not in test-services-linux-debug. This commit ensures that the file is copied from the CI job build-services-linux-debug to the CI job test-services-linux-debug so that go test can use it when compiling and running the tests.

For reference, the CI job https://gitlab.desy.de/asapo/asapo/-/jobs/452044 shows the incorrect versions.

Edited by Marc-Olivier Andrez

Merge request reports

Loading