Skip to content
Snippets Groups Projects
Forked from asapo / asapo
388 commits behind the upstream repository.
  • Marc-Olivier Andrez's avatar
    65e7f0bf
    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
    History
    ci: fix Go tests that internally check the version of a component
    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.
version_lib.go.in 511 B