Skip to content

Commit

Permalink
Merge pull request #165 from testwill/pkg-import
Browse files Browse the repository at this point in the history
chore: import packages only once
  • Loading branch information
elezar authored Sep 26, 2023
2 parents d0e7c3e + 2943a0a commit 00e63d3
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions pkg/cdi/container-edits_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"os"
"testing"

"github.com/container-orchestrated-devices/container-device-interface/specs-go"
cdi "github.com/container-orchestrated-devices/container-device-interface/specs-go"
oci "github.com/opencontainers/runtime-spec/specs-go"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -503,15 +502,15 @@ func TestAppend(t *testing.T) {
dst: nil,
src: []*ContainerEdits{
{
ContainerEdits: &specs.ContainerEdits{
ContainerEdits: &cdi.ContainerEdits{
Env: []string{
"var1=val1",
},
},
},
},
result: &ContainerEdits{
ContainerEdits: &specs.ContainerEdits{
ContainerEdits: &cdi.ContainerEdits{
Env: []string{
"var1=val1",
},
Expand All @@ -521,7 +520,7 @@ func TestAppend(t *testing.T) {
{
name: "merge nil into non-nil",
dst: &ContainerEdits{
ContainerEdits: &specs.ContainerEdits{
ContainerEdits: &cdi.ContainerEdits{
Env: []string{
"var1=val1",
},
Expand All @@ -531,7 +530,7 @@ func TestAppend(t *testing.T) {
nil,
},
result: &ContainerEdits{
ContainerEdits: &specs.ContainerEdits{
ContainerEdits: &cdi.ContainerEdits{
Env: []string{
"var1=val1",
},
Expand All @@ -541,32 +540,32 @@ func TestAppend(t *testing.T) {
{
name: "merge multiple into non-nil",
dst: &ContainerEdits{
ContainerEdits: &specs.ContainerEdits{
ContainerEdits: &cdi.ContainerEdits{
Env: []string{
"var0=val0",
},
},
},
src: []*ContainerEdits{
{
ContainerEdits: &specs.ContainerEdits{
ContainerEdits: &cdi.ContainerEdits{
Env: []string{
"var1=val1",
},
DeviceNodes: []*specs.DeviceNode{
DeviceNodes: []*cdi.DeviceNode{
{
Path: "/dev/dev1",
},
},
},
},
{
ContainerEdits: &specs.ContainerEdits{
ContainerEdits: &cdi.ContainerEdits{
Env: []string{
"var2=val2",
"var3=val3",
},
DeviceNodes: []*specs.DeviceNode{
DeviceNodes: []*cdi.DeviceNode{
{
Path: "/dev/dev2",
},
Expand All @@ -577,11 +576,11 @@ func TestAppend(t *testing.T) {
},
},
{
ContainerEdits: &specs.ContainerEdits{
ContainerEdits: &cdi.ContainerEdits{
Env: []string{
"var4=val4",
},
DeviceNodes: []*specs.DeviceNode{
DeviceNodes: []*cdi.DeviceNode{
{
Path: "/dev/dev4",
},
Expand All @@ -590,15 +589,15 @@ func TestAppend(t *testing.T) {
},
},
result: &ContainerEdits{
ContainerEdits: &specs.ContainerEdits{
ContainerEdits: &cdi.ContainerEdits{
Env: []string{
"var0=val0",
"var1=val1",
"var2=val2",
"var3=val3",
"var4=val4",
},
DeviceNodes: []*specs.DeviceNode{
DeviceNodes: []*cdi.DeviceNode{
{
Path: "/dev/dev1",
},
Expand Down

0 comments on commit 00e63d3

Please sign in to comment.