Skip to content

Commit 00e63d3

Browse files
authored
Merge pull request #165 from testwill/pkg-import
chore: import packages only once
2 parents d0e7c3e + 2943a0a commit 00e63d3

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

pkg/cdi/container-edits_test.go

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"os"
2121
"testing"
2222

23-
"github.com/container-orchestrated-devices/container-device-interface/specs-go"
2423
cdi "github.com/container-orchestrated-devices/container-device-interface/specs-go"
2524
oci "github.com/opencontainers/runtime-spec/specs-go"
2625
"github.com/stretchr/testify/require"
@@ -503,15 +502,15 @@ func TestAppend(t *testing.T) {
503502
dst: nil,
504503
src: []*ContainerEdits{
505504
{
506-
ContainerEdits: &specs.ContainerEdits{
505+
ContainerEdits: &cdi.ContainerEdits{
507506
Env: []string{
508507
"var1=val1",
509508
},
510509
},
511510
},
512511
},
513512
result: &ContainerEdits{
514-
ContainerEdits: &specs.ContainerEdits{
513+
ContainerEdits: &cdi.ContainerEdits{
515514
Env: []string{
516515
"var1=val1",
517516
},
@@ -521,7 +520,7 @@ func TestAppend(t *testing.T) {
521520
{
522521
name: "merge nil into non-nil",
523522
dst: &ContainerEdits{
524-
ContainerEdits: &specs.ContainerEdits{
523+
ContainerEdits: &cdi.ContainerEdits{
525524
Env: []string{
526525
"var1=val1",
527526
},
@@ -531,7 +530,7 @@ func TestAppend(t *testing.T) {
531530
nil,
532531
},
533532
result: &ContainerEdits{
534-
ContainerEdits: &specs.ContainerEdits{
533+
ContainerEdits: &cdi.ContainerEdits{
535534
Env: []string{
536535
"var1=val1",
537536
},
@@ -541,32 +540,32 @@ func TestAppend(t *testing.T) {
541540
{
542541
name: "merge multiple into non-nil",
543542
dst: &ContainerEdits{
544-
ContainerEdits: &specs.ContainerEdits{
543+
ContainerEdits: &cdi.ContainerEdits{
545544
Env: []string{
546545
"var0=val0",
547546
},
548547
},
549548
},
550549
src: []*ContainerEdits{
551550
{
552-
ContainerEdits: &specs.ContainerEdits{
551+
ContainerEdits: &cdi.ContainerEdits{
553552
Env: []string{
554553
"var1=val1",
555554
},
556-
DeviceNodes: []*specs.DeviceNode{
555+
DeviceNodes: []*cdi.DeviceNode{
557556
{
558557
Path: "/dev/dev1",
559558
},
560559
},
561560
},
562561
},
563562
{
564-
ContainerEdits: &specs.ContainerEdits{
563+
ContainerEdits: &cdi.ContainerEdits{
565564
Env: []string{
566565
"var2=val2",
567566
"var3=val3",
568567
},
569-
DeviceNodes: []*specs.DeviceNode{
568+
DeviceNodes: []*cdi.DeviceNode{
570569
{
571570
Path: "/dev/dev2",
572571
},
@@ -577,11 +576,11 @@ func TestAppend(t *testing.T) {
577576
},
578577
},
579578
{
580-
ContainerEdits: &specs.ContainerEdits{
579+
ContainerEdits: &cdi.ContainerEdits{
581580
Env: []string{
582581
"var4=val4",
583582
},
584-
DeviceNodes: []*specs.DeviceNode{
583+
DeviceNodes: []*cdi.DeviceNode{
585584
{
586585
Path: "/dev/dev4",
587586
},
@@ -590,15 +589,15 @@ func TestAppend(t *testing.T) {
590589
},
591590
},
592591
result: &ContainerEdits{
593-
ContainerEdits: &specs.ContainerEdits{
592+
ContainerEdits: &cdi.ContainerEdits{
594593
Env: []string{
595594
"var0=val0",
596595
"var1=val1",
597596
"var2=val2",
598597
"var3=val3",
599598
"var4=val4",
600599
},
601-
DeviceNodes: []*specs.DeviceNode{
600+
DeviceNodes: []*cdi.DeviceNode{
602601
{
603602
Path: "/dev/dev1",
604603
},

0 commit comments

Comments
 (0)