mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-01 19:46:07 -04:00
deps: update Go to v1.24.2 (#3750)
* deps: update Go to v1.24.2 * tests: replace context.Background() with t.Context() --------- Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
parent
a7f9561a3d
commit
4e5c213b4d
112 changed files with 287 additions and 316 deletions
|
@ -123,7 +123,7 @@ func TestDownloadDeployment(t *testing.T) {
|
|||
serviceManager: serviceMgr,
|
||||
}
|
||||
|
||||
err := download.DownloadDeployment(context.Background(), ip)
|
||||
err := download.DownloadDeployment(t.Context(), ip)
|
||||
|
||||
if tc.wantErr {
|
||||
assert.Error(err)
|
||||
|
@ -194,7 +194,7 @@ func TestDownloadInfo(t *testing.T) {
|
|||
info: &tc.infoSetter,
|
||||
}
|
||||
|
||||
err := download.DownloadInfo(context.Background(), ip)
|
||||
err := download.DownloadInfo(t.Context(), ip)
|
||||
|
||||
if tc.wantErr {
|
||||
assert.Error(err)
|
||||
|
|
|
@ -108,7 +108,7 @@ func TestSystemdAction(t *testing.T) {
|
|||
fs: fs,
|
||||
systemdUnitFilewriteLock: sync.Mutex{},
|
||||
}
|
||||
err := manager.SystemdAction(context.Background(), ServiceManagerRequest{
|
||||
err := manager.SystemdAction(t.Context(), ServiceManagerRequest{
|
||||
Unit: unitName,
|
||||
Action: tc.action,
|
||||
})
|
||||
|
@ -188,7 +188,7 @@ func TestWriteSystemdUnitFile(t *testing.T) {
|
|||
fs: fs,
|
||||
systemdUnitFilewriteLock: sync.Mutex{},
|
||||
}
|
||||
err := manager.WriteSystemdUnitFile(context.Background(), tc.unit)
|
||||
err := manager.WriteSystemdUnitFile(t.Context(), tc.unit)
|
||||
|
||||
if tc.wantErr {
|
||||
assert.Error(err)
|
||||
|
@ -302,7 +302,7 @@ func TestOverrideServiceUnitExecStart(t *testing.T) {
|
|||
fs: fs,
|
||||
systemdUnitFilewriteLock: sync.Mutex{},
|
||||
}
|
||||
err := manager.OverrideServiceUnitExecStart(context.Background(), tc.unitName, tc.execStart)
|
||||
err := manager.OverrideServiceUnitExecStart(t.Context(), tc.unitName, tc.execStart)
|
||||
|
||||
if tc.wantErr {
|
||||
assert.Error(err)
|
||||
|
|
|
@ -67,7 +67,7 @@ func TestGetOpensearchCredentialsGCP(t *testing.T) {
|
|||
|
||||
g := &gcpCloudCredentialGetter{secretsAPI: tc.gcpAPI}
|
||||
|
||||
gotCreds, err := g.GetOpensearchCredentials(context.Background())
|
||||
gotCreds, err := g.GetOpensearchCredentials(t.Context())
|
||||
|
||||
if tc.wantErr {
|
||||
assert.Error(err)
|
||||
|
@ -127,7 +127,7 @@ func TestGetOpensearchCredentialsAzure(t *testing.T) {
|
|||
|
||||
a := &azureCloudCredentialGetter{secretsAPI: tc.azureAPI}
|
||||
|
||||
gotCreds, err := a.GetOpensearchCredentials(context.Background())
|
||||
gotCreds, err := a.GetOpensearchCredentials(t.Context())
|
||||
|
||||
if tc.wantErr {
|
||||
assert.Error(err)
|
||||
|
@ -184,7 +184,7 @@ func TestGetOpensearchCredentialsAWS(t *testing.T) {
|
|||
|
||||
a := &awsCloudCredentialGetter{secretmanager: tc.awsAPI}
|
||||
|
||||
gotCreds, err := a.GetOpensearchCredentials(context.Background())
|
||||
gotCreds, err := a.GetOpensearchCredentials(t.Context())
|
||||
|
||||
if tc.wantErr {
|
||||
assert.Error(err)
|
||||
|
|
|
@ -56,7 +56,7 @@ func TestRole(t *testing.T) {
|
|||
|
||||
fetcher := Fetcher{tc.meta}
|
||||
|
||||
role, err := fetcher.Role(context.Background())
|
||||
role, err := fetcher.Role(t.Context())
|
||||
|
||||
if tc.wantErr {
|
||||
assert.Error(err)
|
||||
|
@ -110,7 +110,7 @@ func TestDiscoverDebugIPs(t *testing.T) {
|
|||
fetcher := Fetcher{
|
||||
metaAPI: &tc.meta,
|
||||
}
|
||||
ips, err := fetcher.DiscoverDebugdIPs(context.Background())
|
||||
ips, err := fetcher.DiscoverDebugdIPs(t.Context())
|
||||
|
||||
if tc.wantErr {
|
||||
assert.Error(err)
|
||||
|
@ -149,7 +149,7 @@ func TestDiscoverLoadBalancerIP(t *testing.T) {
|
|||
metaAPI: tc.metaAPI,
|
||||
}
|
||||
|
||||
ip, err := fetcher.DiscoverLoadBalancerIP(context.Background())
|
||||
ip, err := fetcher.DiscoverLoadBalancerIP(t.Context())
|
||||
|
||||
if tc.wantErr {
|
||||
assert.Error(err)
|
||||
|
|
|
@ -7,7 +7,6 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
package fallback
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/edgelesssys/constellation/v2/internal/role"
|
||||
|
@ -23,19 +22,19 @@ func TestDiscoverDebugdIPs(t *testing.T) {
|
|||
assert := assert.New(t)
|
||||
|
||||
fetcher := NewFallbackFetcher()
|
||||
ips, err := fetcher.DiscoverDebugdIPs(context.Background())
|
||||
ips, err := fetcher.DiscoverDebugdIPs(t.Context())
|
||||
assert.NoError(err)
|
||||
assert.Empty(ips)
|
||||
|
||||
rol, err := fetcher.Role(context.Background())
|
||||
rol, err := fetcher.Role(t.Context())
|
||||
assert.NoError(err)
|
||||
assert.Equal(rol, role.Unknown)
|
||||
|
||||
uid, err := fetcher.UID(context.Background())
|
||||
uid, err := fetcher.UID(t.Context())
|
||||
assert.NoError(err)
|
||||
assert.Empty(uid)
|
||||
|
||||
self, err := fetcher.Self(context.Background())
|
||||
self, err := fetcher.Self(t.Context())
|
||||
assert.NoError(err)
|
||||
assert.Empty(self)
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ func TestSchedulerStart(t *testing.T) {
|
|||
}
|
||||
|
||||
wg := &sync.WaitGroup{}
|
||||
scheduler.Start(context.Background(), wg)
|
||||
scheduler.Start(t.Context(), wg)
|
||||
wg.Wait()
|
||||
|
||||
assert.Equal(tc.wantDeploymentDownloads, tc.downloader.downloadDeploymentIPs)
|
||||
|
|
|
@ -79,7 +79,7 @@ func TestSetInfo(t *testing.T) {
|
|||
defer conn.Close()
|
||||
client := pb.NewDebugdClient(conn)
|
||||
|
||||
setInfoStatus, err := client.SetInfo(context.Background(), &pb.SetInfoRequest{Info: tc.setInfo})
|
||||
setInfoStatus, err := client.SetInfo(t.Context(), &pb.SetInfoRequest{Info: tc.setInfo})
|
||||
grpcServ.GracefulStop()
|
||||
|
||||
assert.NoError(err)
|
||||
|
@ -137,7 +137,7 @@ func TestGetInfo(t *testing.T) {
|
|||
defer conn.Close()
|
||||
client := pb.NewDebugdClient(conn)
|
||||
|
||||
resp, err := client.GetInfo(context.Background(), &pb.GetInfoRequest{})
|
||||
resp, err := client.GetInfo(t.Context(), &pb.GetInfoRequest{})
|
||||
grpcServ.GracefulStop()
|
||||
|
||||
if tc.wantErr {
|
||||
|
@ -201,7 +201,7 @@ func TestUploadFiles(t *testing.T) {
|
|||
require.NoError(err)
|
||||
defer conn.Close()
|
||||
client := pb.NewDebugdClient(conn)
|
||||
stream, err := client.UploadFiles(context.Background())
|
||||
stream, err := client.UploadFiles(t.Context())
|
||||
require.NoError(err)
|
||||
resp, err := stream.CloseAndRecv()
|
||||
|
||||
|
@ -245,7 +245,7 @@ func TestDownloadFiles(t *testing.T) {
|
|||
require.NoError(err)
|
||||
defer conn.Close()
|
||||
client := pb.NewDebugdClient(conn)
|
||||
stream, err := client.DownloadFiles(context.Background(), tc.request)
|
||||
stream, err := client.DownloadFiles(t.Context(), tc.request)
|
||||
require.NoError(err)
|
||||
_, recvErr := stream.Recv()
|
||||
if tc.wantRecvErr {
|
||||
|
@ -324,7 +324,7 @@ func TestUploadSystemServiceUnits(t *testing.T) {
|
|||
require.NoError(err)
|
||||
defer conn.Close()
|
||||
client := pb.NewDebugdClient(conn)
|
||||
resp, err := client.UploadSystemServiceUnits(context.Background(), tc.request)
|
||||
resp, err := client.UploadSystemServiceUnits(t.Context(), tc.request)
|
||||
|
||||
grpcServ.GracefulStop()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue