Skip to content

Commit

Permalink
Bump minimum Go version to 1.18 and update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gl-johnson committed Jan 26, 2023
1 parent 4aadb42 commit dd8c4ad
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 40 deletions.
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ and will run all tests.

To run the tests against a specific version of Golang, you can run the following:
```shell
./bin/test.sh 1.17
./bin/test.sh 1.18
```

This will spin up a containerized Conjur environment and build the test containers,
and will run the tests in a `golang:1.17` container
and will run the tests in a `golang:1.18` container

Supported arguments are `1.17`, `1.18`, and `1.19`, with the
default being `1.17` if no argument is given.
Supported arguments are `1.18` and `1.19`, with the
default being `1.18` if no argument is given.

### Setting up a development environment
To start a container with terminal access, and the necessary
Expand Down
15 changes: 4 additions & 11 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,20 @@ pipeline {
}
stage('Run Tests') {
parallel {
stage('Run tests: Golang 1.19') {
stage('Golang 1.19') {
steps {
sh './bin/test.sh 1.19'
junit 'output/1.19/junit.xml'
}
}

stage('Run tests: Golang 1.18') {
stage('Golang 1.18') {
steps {
sh './bin/test.sh 1.18'
junit 'output/1.18/junit.xml'
}
}

stage('Run tests: Golang 1.17') {
steps {
sh './bin/test.sh 1.17'
junit 'output/1.17/junit.xml'
cobertura autoUpdateHealth: false,
autoUpdateStability: false,
coberturaReportFile: 'output/1.17/coverage.xml',
coberturaReportFile: 'output/1.18/coverage.xml',
conditionalCoverageTargets: '30, 0, 0',
failUnhealthy: true,
failUnstable: false,
Expand All @@ -52,7 +45,7 @@ pipeline {
onlyStable: false,
sourceEncoding: 'ASCII',
zoomCoverageChart: false
sh 'cp output/1.17/c.out .'
sh 'cp output/1.18/c.out .'
ccCoverage("gocov", "--prefix github.com/cyberark/conjur-api-go")
}
}
Expand Down
28 changes: 28 additions & 0 deletions NOTICES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ SECTION 2: MIT License
>>> github.com/stretchr/testify-v1.7.0
https://github.com/stretchr/testify/blob/v1.7.2/LICENSE

>>> github.com/zalando/go-keyring-v0.2.2
https://github.com/zalando/go-keyring/blob/v0.2.2/LICENSE

>>> gopkg.in/yaml.v2-v2.4.0
https://github.com/go-yaml/yaml/blob/v2.4.0/LICENSE.libyaml

Expand Down Expand Up @@ -133,6 +136,31 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


>>> github.com/zalando/go-keyring-v0.2.2

The MIT License (MIT)

Copyright (c) 2016 Zalando SE

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


>>> gopkg.in/yaml.v2-v2.4.0

The following files were ported to Go from C files of libyaml, and thus
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ compatibility. When possible, upgrade your Conjur version to match the
when using integrations, choose the latest suite release that matches your Conjur version. For any
questions, please contact us on [Discourse](https://discuss.cyberarkcommons.org/c/conjur/5).

## Compatability
## Compatibility

The `conjur-api-go` has been tested against the following Go versions:

- 1.17
- 1.17 (EOL)
- 1.18
- 1.19

## Installation

Expand Down
4 changes: 2 additions & 2 deletions bin/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cd "$(dirname "$0")"
trap teardown EXIT

export COMPOSE_PROJECT_NAME="conjurapigo_$(openssl rand -hex 3)"
export GO_VERSION="${1:-"1.17"}"
export GO_VERSION="${1:-"1.18"}"

# Spin up Conjur environment
source ./start-conjur.sh
Expand All @@ -24,7 +24,7 @@ failed() {
exit 1
}

# Golang container version to use: `1.17`, `1.18`, or `1.19`
# Golang container version to use: `1.18` or `1.19`
announce "Running tests for Go version: $GO_VERSION...";
docker-compose run \
-e CONJUR_AUTHN_API_KEY \
Expand Down
19 changes: 0 additions & 19 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,6 @@ services:
CONJUR_APPLIANCE_URL: http://conjur
CONJUR_ACCOUNT: cucumber

test-1.17:
build:
context: .
args:
FROM_IMAGE: "golang:1.17"
ports:
- 8080
depends_on:
- conjur
volumes:
- ./output:/conjur-api-go/output
environment:
CONJUR_DATA_KEY:
CONJUR_APPLIANCE_URL: http://conjur
CONJUR_ACCOUNT: cucumber
CONJUR_AUTHN_LOGIN: admin
CONJUR_AUTHN_API_KEY:
GO_VERSION:

test-1.18:
build:
context: .
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/cyberark/conjur-api-go

go 1.17
go 1.18

require (
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d
Expand All @@ -24,4 +24,3 @@ require (
)

replace gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c => gopkg.in/yaml.v3 v3.0.1

0 comments on commit dd8c4ad

Please sign in to comment.