File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 3737 sudo ip addr
3838
3939 - name : Run Unit tests
40+ env :
41+ DOCKER_USERNAME : ${{ secrets.DOCKER_USERNAME }}
42+ DOCKER_PASSWORD : ${{ secrets.DOCKER_PASSWORD }}
4043 run : |-
4144 # switch to installed go
4245 sudo ln -sf `which go` `sudo which go`
Original file line number Diff line number Diff line change @@ -18,13 +18,20 @@ package job
1818
1919import (
2020 "context"
21+ "os"
2122 "testing"
2223 "time"
2324
2425 "github.com/stretchr/testify/assert"
2526)
2627
2728func TestPreheat_CreatePreheatRequestsByManifestURL (t * testing.T ) {
29+ username := os .Getenv ("DOCKER_USERNAME" )
30+ password := os .Getenv ("DOCKER_PASSWORD" )
31+ if username == "" || password == "" {
32+ t .Skip ("DOCKER_USERNAME or DOCKER_PASSWORD is not set, skipping test" )
33+ }
34+
2835 tests := []struct {
2936 name string
3037 req * ManifestRequest
@@ -34,6 +41,8 @@ func TestPreheat_CreatePreheatRequestsByManifestURL(t *testing.T) {
3441 name : "get image layers with manifest url" ,
3542 req : & ManifestRequest {
3643 URL : "https://registry-1.docker.io/v2/dragonflyoss/busybox/manifests/1.35.0" ,
44+ Username : username ,
45+ Password : password ,
3746 Timeout : 30 * time .Second ,
3847 InsecureSkipVerify : true ,
3948 },
@@ -47,6 +56,8 @@ func TestPreheat_CreatePreheatRequestsByManifestURL(t *testing.T) {
4756 req : & ManifestRequest {
4857 URL : "https://registry-1.docker.io/v2/dragonflyoss/scheduler/manifests/v2.1.0" ,
4958 Platform : "linux/amd64" ,
59+ Username : username ,
60+ Password : password ,
5061 Timeout : 30 * time .Second ,
5162 InsecureSkipVerify : true ,
5263 },
You can’t perform that action at this time.
0 commit comments