Skip to content

Commit

Permalink
Merge pull request #21 from Axway/fix_ci
Browse files Browse the repository at this point in the history
Fix CI
  • Loading branch information
sagarkal authored May 3, 2021
2 parents a60d014 + 1a35606 commit ba74afe
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:
make build-discovery .
go test ./...
- name: Discovery Release (Snapshot)
uses: goreleaser/goreleaser-action@master
uses: goreleaser/goreleaser-action@v2.5.0
with:
workdir: .
workdir: ./cmd/discovery
args: release --snapshot --skip-publish --rm-dist

build-traceability:
Expand All @@ -47,7 +47,7 @@ jobs:
make build-trace
go test ./...
- name: Traceability Release (Snapshot)
uses: goreleaser/goreleaser-action@master
uses: goreleaser/goreleaser-action@v2.5.0
with:
workdir: .
workdir: ./cmd/traceability
args: release --snapshot --skip-publish --rm-dist
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
with:
go-version: '^1.13.0'
- name: Discovery Release
uses: goreleaser/goreleaser-action@master
uses: goreleaser/goreleaser-action@v2.5.0
with:
workdir: .
workdir: ./cmd/discovery
args: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -33,9 +33,9 @@ jobs:
with:
go-version: '^1.13.0'
- name: Traceability Release
uses: goreleaser/goreleaser-action@master
uses: goreleaser/goreleaser-action@v2.5.0
with:
workdir: .
workdir: ./cmd/traceability
args: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75 h1:f0n1xnMSmBLzVf
github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75/go.mod h1:g2644b03hfBX9Ov0ZBDgXXens4rxSxmqFBbhvKv2yVA=
github.com/gorilla/mux v1.7.2 h1:zoNxOV7WjqXptQOVngLmcSQgXmgk4NMz1HibBchjl/I=
github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
Expand Down
14 changes: 7 additions & 7 deletions pkg/discovery/discover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ func (m *mockAnypointClient) ListAssets(*anypoint.Page) ([]anypoint.Asset, error
ExchangeAssetName: "dummyasset",
APIs: []anypoint.API{{
ID: 6789,
EndpointURI: "google.com",
EndpointURI: "http://google.com",
AssetID: "12345",
}},
}}

return assets, nil
}

func (m *mockAnypointClient) GetPolicies(*anypoint.API) ([]anypoint.Policy, error) {
return nil, nil
func (m *mockAnypointClient) GetPolicies(*anypoint.API) (anypoint.Policies, error) {
return anypoint.Policies{}, nil
}

func (m *mockAnypointClient) GetExchangeAsset(*anypoint.API) (*anypoint.ExchangeAsset, error) {
Expand Down Expand Up @@ -110,7 +110,7 @@ func TestDiscoverAPIs(t *testing.T) {
assert.Equal(t, "12345", sd.APIName)
assert.Equal(t, "oas2", sd.ResourceType)
assert.Equal(t, "6789", sd.ID)
assert.Equal(t, []byte("{\"basePath\":\"google.com\",\"host\":\"\",\"schemes\":[\"\"],\"swagger\":\"2.0\"}"), sd.APISpec)
assert.Equal(t, []byte("{\"schemes\":[\"http\"],\"swagger\":\"2.0\",\"host\":\"google.com\",\"basePath\":\"/\",\"paths\":null,\"definitions\":null}"), sd.APISpec)
assert.NotEmpty(t, sd.ServiceAttributes["checksum"])
case <-time.After(time.Second * 1):
t.Errorf("Timed out waiting for the discovery")
Expand Down Expand Up @@ -227,7 +227,7 @@ func TestGetServiceDetailWhenExchangeAssetSpecFileIsEmpty(t *testing.T) {

mc.Reqs["/apimanager/api/v1/organizations/333/environments/111/apis/456/policies"] = &api.Response{
Code: 200,
Body: []byte(`[{}]`),
Body: []byte(`[]`),
}

mc.Reqs["/exchange/api/v2/assets/123/456/89"] = &api.Response{
Expand Down Expand Up @@ -457,8 +457,8 @@ func TestSetOAS2Endpoint(t *testing.T) {
{
name: "Should return spec that has OAS2 endpoint set",
endPointURL: "http://google.com",
specContent: []byte("{\"basePath\":\"google.com\",\"host\":\"\",\"schemes\":[\"\"],\"swagger\":\"2.0\"}"),
result: []byte("{\"basePath\":\"\",\"host\":\"google.com\",\"schemes\":[\"http\"],\"swagger\":\"2.0\"}"),
specContent: []byte("{\"basePath\":\"\",\"host\":\"\",\"schemes\":[\"\"],\"swagger\":\"2.0\"}"),
result: []byte("{\"basePath\":\"/\",\"host\":\"google.com\",\"schemes\":[\"http\"],\"swagger\":\"2.0\"}"),
err: nil,
},
}
Expand Down

0 comments on commit ba74afe

Please sign in to comment.