Skip to content
Snippets Groups Projects
  1. May 29, 2024
    • Marc-Olivier Andrez's avatar
      ci: fix Go tests that internally check the version of a component · 65e7f0bf
      Marc-Olivier Andrez authored
      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:
      
      ```go
      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 5100fbee"
      	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. If
      the file does not exist, `go test` won't be able to compile the tests.
      65e7f0bf
  2. Mar 24, 2021
  3. Oct 01, 2018
  4. Sep 28, 2018
  5. Jun 22, 2018
Loading