Skip to content

Commit

Permalink
upgrade to golang 1.21, fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
reinkrul committed Dec 11, 2023
1 parent a1a264a commit 7209f96
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# golang alpine
FROM golang:1.20.6-alpine as builder
FROM golang:1.21.5-alpine as builder

ARG TARGETARCH
ARG TARGETOS
Expand Down
14 changes: 7 additions & 7 deletions auth/services/selfsigned/signer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ func TestSessionStore_SigningSessionStatus(t *testing.T) {
t.Run("status completed returns VP on SigningSessionResult", func(t *testing.T) {
mockContext := newMockContext(t)
ss := NewSigner(mockContext.vcr, "").(*signer)
mockContext.issuer.EXPECT().Issue(context.TODO(), gomock.Any(), false, false).Return(&testVC, nil)
mockContext.holder.EXPECT().BuildVP(context.TODO(), gomock.Len(1), gomock.Any(), &employer, true).Return(&testVP, nil)
mockContext.issuer.EXPECT().Issue(context.Background(), gomock.Any(), false, false).Return(&testVC, nil)
mockContext.holder.EXPECT().BuildVP(context.Background(), gomock.Len(1), gomock.Any(), &employer, true).Return(&testVP, nil)

sp, err := ss.StartSigningSession(contract.Contract{RawContractText: testContract}, params)
require.NoError(t, err)
Expand Down Expand Up @@ -237,7 +237,7 @@ func TestSessionStore_SigningSessionStatus(t *testing.T) {
t.Run("correct VC options are passed to issuer", func(t *testing.T) {
mockContext := newMockContext(t)
ss := NewSigner(mockContext.vcr, "").(*signer)
mockContext.issuer.EXPECT().Issue(context.TODO(), gomock.Any(), false, false).DoAndReturn(
mockContext.issuer.EXPECT().Issue(context.Background(), gomock.Any(), false, false).DoAndReturn(
func(arg0 interface{}, unsignedCredential interface{}, public interface{}, publish interface{}) (*vc.VerifiableCredential, error) {
isPublic, ok := public.(bool)
isPublished, ok2 := publish.(bool)
Expand Down Expand Up @@ -265,7 +265,7 @@ func TestSessionStore_SigningSessionStatus(t *testing.T) {

return &testVC, nil
})
mockContext.holder.EXPECT().BuildVP(context.TODO(), gomock.Len(1), gomock.Any(), &employer, true).Return(&testVP, nil)
mockContext.holder.EXPECT().BuildVP(context.Background(), gomock.Len(1), gomock.Any(), &employer, true).Return(&testVP, nil)

sp, err := ss.StartSigningSession(contract.Contract{RawContractText: testContract}, params)
require.NoError(t, err)
Expand All @@ -287,7 +287,7 @@ func TestSessionStore_SigningSessionStatus(t *testing.T) {
t.Run("error on VC issuance", func(t *testing.T) {
mockContext := newMockContext(t)
ss := NewSigner(mockContext.vcr, "").(*signer)
mockContext.issuer.EXPECT().Issue(context.TODO(), gomock.Any(), false, false).Return(nil, errors.New("error"))
mockContext.issuer.EXPECT().Issue(context.Background(), gomock.Any(), false, false).Return(nil, errors.New("error"))

sp, err := ss.StartSigningSession(contract.Contract{RawContractText: testContract}, params)
require.NoError(t, err)
Expand All @@ -302,8 +302,8 @@ func TestSessionStore_SigningSessionStatus(t *testing.T) {
t.Run("error on building VP", func(t *testing.T) {
mockContext := newMockContext(t)
ss := NewSigner(mockContext.vcr, "").(*signer)
mockContext.issuer.EXPECT().Issue(context.TODO(), gomock.Any(), false, false).Return(&testVC, nil)
mockContext.holder.EXPECT().BuildVP(context.TODO(), gomock.Len(1), gomock.Any(), &employer, true).Return(nil, errors.New("error"))
mockContext.issuer.EXPECT().Issue(context.Background(), gomock.Any(), false, false).Return(&testVC, nil)
mockContext.holder.EXPECT().BuildVP(context.Background(), gomock.Len(1), gomock.Any(), &employer, true).Return(nil, errors.New("error"))

sp, err := ss.StartSigningSession(contract.Contract{RawContractText: testContract}, params)
require.NoError(t, err)
Expand Down
2 changes: 1 addition & 1 deletion http/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func TestEngine_Configure(t *testing.T) {
thisTLSConfig := tlsConfig.Clone()
thisTLSConfig.Certificates = nil
_, err = doHTTPSRequest(thisTLSConfig, engine.config.InterfaceConfig.Address)
assert.ErrorContains(t, err, "tls: bad certificate")
assert.ErrorContains(t, err, "tls: certificate required")

err = engine.Shutdown()
assert.NoError(t, err)
Expand Down
2 changes: 1 addition & 1 deletion network/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,7 @@ func TestNetwork_checkHealth(t *testing.T) {
result := n.CheckHealth()

assert.Equal(t, core.HealthStatusDown, result[healthTLS].Status)
assert.Equal(t, "x509: certificate signed by unknown authority", result[healthTLS].Details)
assert.Contains(t, result[healthTLS].Details, "x509: certificate has expired or is not yet valid")
})
})

Expand Down

0 comments on commit 7209f96

Please sign in to comment.