Skip to content

Commit

Permalink
Merge pull request #1191 from npamudika/4.1.x
Browse files Browse the repository at this point in the history
Add changes for 4.1.4 Release
  • Loading branch information
npamudika authored Sep 24, 2024
2 parents 78efc21 + f2d6e46 commit afe0abd
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
run: |
cd import-export-cli
go vet ./...
./build.sh -t apictl.go -v 4.1.3
./build.sh -t apictl.go -v 4.1.4
- name: Start APIM
run: |
Expand All @@ -69,4 +69,4 @@ jobs:
- name: Test
run: |
cd import-export-cli/integration
go test -p 1 -timeout 0 -archive apictl-4.1.3-linux-x64.tar.gz -race -coverprofile=coverage.txt -covermode=atomic ./pkg/...
go test -p 1 -timeout 0 -archive apictl-4.1.4-linux-x64.tar.gz -race -coverprofile=coverage.txt -covermode=atomic ./pkg/...
6 changes: 3 additions & 3 deletions import-export-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Command Line tool for importing and exporting APIs/Applications/API Products in
- ### Building
`cd` into `product-apim-tooling/import-export-cli`

Execute `./build.sh -t apictl.go -v 4.1.3 -f` to build for all platforms.
Execute `./build.sh -t apictl.go -v 4.1.4 -f` to build for all platforms.

Created packages will be available at `build/target` directory

Expand Down Expand Up @@ -65,11 +65,11 @@ Command Line tool for importing and exporting APIs/Applications/API Products in

Usage: `docker build --build-arg version=<version> -t apictl:<version> .`

Example: `docker build --build-arg version=4.1.3.1 -t apictl:4.1.3.1 .`
Example: `docker build --build-arg version=4.1.4.1 -t apictl:4.1.4.1 .`

- ### Using the Docker Image

`docker run -it -v $(pwd):/git -v ~/.wso2apictl:/root/.wso2apictl -v ~/.wso2apictl.local:/root/.wso2apictl.local apictl:4.1.3.1 <apictl command>`
`docker run -it -v $(pwd):/git -v ~/.wso2apictl:/root/.wso2apictl -v ~/.wso2apictl.local:/root/.wso2apictl.local apictl:4.1.4.1 <apictl command>`

***

Expand Down
10 changes: 5 additions & 5 deletions import-export-cli/integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ devops-rest-api-version: v0
The version of the apictl that is being integration tested.

```
apictl-version: 4.1.3
apictl-version: 4.1.4
```


Expand Down Expand Up @@ -95,7 +95,7 @@ apictl-version: 4.1.3
```
go test -p 1 -timeout 0 -archive <apictl archive name>
example: go test -p 1 -timeout 0 -archive apictl-4.1.3-linux-x64.tar.gz
example: go test -p 1 -timeout 0 -archive apictl-4.1.4-linux-x64.tar.gz
```
Expand All @@ -104,23 +104,23 @@ example: go test -p 1 -timeout 0 -archive apictl-4.1.3-linux-x64.tar.gz
```
go test -p 1 -timeout 0 -archive <apictl archive name> -run <Test function name or partial name regex>
example: go test -p 1 -timeout 0 -archive apictl-4.1.3-linux-x64.tar.gz -run TestVersion
example: go test -p 1 -timeout 0 -archive apictl-4.1.4-linux-x64.tar.gz -run TestVersion
```

- Print verbose output

```
go test -p 1 -timeout 0 -archive <apictl archive name> -v
example: go test -p 1 -timeout 0 -archive apictl-4.1.3-linux-x64.tar.gz -v
example: go test -p 1 -timeout 0 -archive apictl-4.1.4-linux-x64.tar.gz -v
```

- Print http transport request/responses

```
go test -p 1 -timeout 0 -archive <apictl archive name> -logtransport
example: go test -p 1 -timeout 0 -archive apictl-4.1.3-linux-x64.tar.gz -logtransport
example: go test -p 1 -timeout 0 -archive apictl-4.1.4-linux-x64.tar.gz -logtransport
```

---
Expand Down
4 changes: 2 additions & 2 deletions import-export-cli/integration/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ environments:
host: localhost
offset: 1
# duration tests will wait to allow APIM solr indexes to be updated
indexing-delay: 1000
indexing-delay: 1500
# max number of retry attempts made to successfully invoke an API, to compensate for delay in API artifact deployment
max-invocation-attempts: 10

Expand All @@ -19,5 +19,5 @@ admin-rest-api-version: v3
devportal-rest-api-version: v2
publisher-rest-api-version: v3
devops-rest-api-version: v0
apictl-version: 4.1.3
apictl-version: 4.1.4

1 change: 1 addition & 0 deletions import-export-cli/integration/testutils/apiParams.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,5 @@ type MsslCert struct {
TierName string `yaml:"tierName"`
Alias string `yaml:"alias"`
Path string `yaml:"path"`
KeyType string `yaml:"keyType"`
}
2 changes: 1 addition & 1 deletion import-export-cli/integration/testutils/api_testUtils.go
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,7 @@ func ValidateAPIDeleteFailure(t *testing.T, args *ApiImportExportTestArgs) {
}

func exportApiImportedFromProject(t *testing.T, APIName string, APIVersion string, EnvName string) (string, error) {
return base.Execute(t, "export", "api", "-n", APIName, "-v", APIVersion, "-e", EnvName)
return base.Execute(t, "export", "api", "-n", APIName, "-v", APIVersion, "-e", EnvName, "-k")
}

func exportAllApisOfATenant(t *testing.T, args *ApiImportExportTestArgs) (string, error) {
Expand Down
16 changes: 10 additions & 6 deletions import-export-cli/integration/testutils/environment_testUtils.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func InitProjectWithOasFlag(t *testing.T, args *InitTestArgs) (string, error) {
base.SetupEnvWithoutTokenFlag(t, args.SrcAPIM.GetEnvName(), args.SrcAPIM.GetApimURL())
base.Login(t, args.SrcAPIM.GetEnvName(), args.CtlUser.Username, args.CtlUser.Password)

output, err := base.Execute(t, "init", args.InitFlag, "--oas", args.OasFlag, "--verbose", "-f")
output, err := base.Execute(t, "init", args.InitFlag, "--oas", args.OasFlag, "--verbose", "-f", "-k")
return output, err
}

Expand Down Expand Up @@ -330,7 +330,7 @@ func validateEndpointSecurity(t *testing.T, apiParams *Params, api *apim.API, en
if strings.EqualFold(strings.ToUpper(endpointSecurityForEndpointType.Type), EndpointSecurityTypeOAuth) {
// Validate Oauth 2.0 endpoint security related properties
assert.Equal(t, endpointSecurityForEndpointType.ClientId, endpointSecurityForEndpointTypeInApi["clientId"])
assert.Equal(t, endpointSecurityForEndpointType.ClientSecret, endpointSecurityForEndpointTypeInApi["clientSecret"])
assert.Equal(t, "", endpointSecurityForEndpointTypeInApi["clientSecret"])
assert.Equal(t, endpointSecurityForEndpointType.TokenUrl, endpointSecurityForEndpointTypeInApi["tokenUrl"])
assert.Equal(t, strings.ToUpper(endpointSecurityForEndpointType.GrantType), endpointSecurityForEndpointTypeInApi["grantType"])

Expand Down Expand Up @@ -505,12 +505,16 @@ func validateMutualSSLCerts(t *testing.T, apiParams *Params, path string) {
isClientCertsDirExists, _ := utils.IsDirExists(pathOfExportedMsslCerts)

if isClientCertsDirExists {
files, _ := ioutil.ReadDir(pathOfExportedMsslCerts)
for _, msslCert := range apiParams.Environments[0].Configs.MsslCerts {
pathToCert := pathOfExportedMsslCerts + string(os.PathSeparator) + msslCert.KeyType
isPathToCertExist, _ := utils.IsDirExists(pathToCert)
msslCertExists := false
for _, file := range files {
if strings.EqualFold(file.Name(), msslCert.Path) {
msslCertExists = true
if isPathToCertExist {
files, _ := ioutil.ReadDir(pathToCert)
for _, file := range files {
if strings.EqualFold(file.Name(), msslCert.Path) {
msslCertExists = true
}
}
}
if !msslCertExists {
Expand Down
8 changes: 4 additions & 4 deletions import-export-cli/mi/integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
```
go test -archive <apictl archive name>
example: go test -archive apictl-4.1.3-linux-x64.tar.gz
example: go test -archive apictl-4.1.4-linux-x64.tar.gz
```

Expand All @@ -71,21 +71,21 @@ example: go test -archive apictl-4.1.3-linux-x64.tar.gz
```
go test -archive <apictl archive name> -test.run <Test function name or partial name regex>
example: go test -archive apictl-4.1.3-linux-x64.tar.gz -test.run TestGetConnectors
example: go test -archive apictl-4.1.4-linux-x64.tar.gz -test.run TestGetConnectors
```

- Print verbose output

```
go test -archive <apictl archive name> -test.v
example: go test -archive apictl-4.1.3-linux-x64.tar.gz -test.v
example: go test -archive apictl-4.1.4-linux-x64.tar.gz -test.v
```

- Print http transport request/responses

```
go test -archive <apictl archive name> -logtransport
example: go test -archive apictl-4.1.3-linux-x64.tar.gz -logtransport
example: go test -archive apictl-4.1.4-linux-x64.tar.gz -logtransport
```

0 comments on commit afe0abd

Please sign in to comment.