Merge pull request #7530 from kzys/critest-ginkgo-v2

This commit is contained in:
Samuel Karp
2022-10-18 11:41:34 -07:00
committed by GitHub
7 changed files with 35 additions and 16 deletions

View File

@@ -23,6 +23,7 @@ import (
"testing"
"github.com/containerd/containerd"
"github.com/containerd/containerd/log/logtest"
"github.com/containerd/containerd/pkg/cri/constants"
"github.com/containerd/containerd/platforms"
"github.com/containerd/containerd/plugin"
@@ -61,7 +62,7 @@ var (
// buildLocalContainerdClient is to return containerd client with initialized
// core plugins in local.
func buildLocalContainerdClient(t *testing.T, tmpDir string) *containerd.Client {
ctx := context.Background()
ctx := logtest.WithT(context.Background(), t)
// load plugins
loadPluginOnce.Do(func() {

View File

@@ -37,6 +37,7 @@ import (
"github.com/containerd/containerd/content"
"github.com/containerd/containerd/leases"
"github.com/containerd/containerd/log"
"github.com/containerd/containerd/log/logtest"
"github.com/containerd/containerd/namespaces"
criconfig "github.com/containerd/containerd/pkg/cri/config"
criserver "github.com/containerd/containerd/pkg/cri/server"
@@ -79,7 +80,7 @@ func testCRIImagePullTimeoutByHoldingContentOpenWriter(t *testing.T) {
criService, err := initLocalCRIPlugin(cli, tmpDir, criconfig.Registry{})
assert.NoError(t, err)
ctx := namespaces.WithNamespace(context.Background(), k8sNamespace)
ctx := namespaces.WithNamespace(logtest.WithT(context.Background(), t), k8sNamespace)
contentStore := cli.ContentStore()
// imageIndexJSON is the manifest of ghcr.io/containerd/volume-ownership:2.1.
@@ -241,7 +242,7 @@ func testCRIImagePullTimeoutByNoDataTransferred(t *testing.T) {
err = os.WriteFile(filepath.Join(hostCfgDir, "hosts.toml"), []byte(hostTomlContent), 0600)
assert.NoError(t, err)
ctx := namespaces.WithNamespace(context.Background(), k8sNamespace)
ctx := namespaces.WithNamespace(logtest.WithT(context.Background(), t), k8sNamespace)
for idx, registryCfg := range []criconfig.Registry{
{
ConfigPath: filepath.Dir(hostCfgDir),