fix linter issues

This commit is contained in:
Simon Aronsson 2020-11-15 23:48:43 +01:00
parent 6b9fd8d7ef
commit a32468d1fe
No known key found for this signature in database
GPG key ID: 8DA57A5FD341605B
9 changed files with 64 additions and 61 deletions

View file

@ -52,44 +52,42 @@ func SkipIfCredentialsEmpty(credentials *wtTypes.RegistryCredentials, fn func())
}
var _ = Describe("Digests", func() {
When("fetching a bearer token", func() {
var ctx = logger.AddDebugLogger(context.Background())
When("fetching a bearer token", func() {
It("should parse the token from the response",
SkipIfCredentialsEmpty(GHCRCredentials, func() {
token, err := auth.GetToken(ctx, ghImage, GHCRCredentials)
Expect(err).NotTo(HaveOccurred())
Expect(token).NotTo(Equal(""))
}),
)
})
When("a digest comparison is done", func() {
It("should return true if digests match",
SkipIfCredentialsEmpty(GHCRCredentials, func() {
matches, err := CompareDigest(ctx, ghImage, GHCRCredentials)
Expect(err).NotTo(HaveOccurred())
Expect(matches).To(Equal(true))
}),
)
It("should return false if digests differ", func() {
It("should parse the token from the response",
SkipIfCredentialsEmpty(GHCRCredentials, func() {
ctx := context.Background()
logger.AddDebugLogger(ctx)
token, err := auth.GetToken(ctx, ghImage, GHCRCredentials)
Expect(err).NotTo(HaveOccurred())
Expect(token).NotTo(Equal(""))
}),
)
})
When("a digest comparison is done", func() {
It("should return true if digests match",
SkipIfCredentialsEmpty(GHCRCredentials, func() {
ctx := context.Background()
logger.AddDebugLogger(ctx)
matches, err := CompareDigest(ctx, ghImage, GHCRCredentials)
Expect(err).NotTo(HaveOccurred())
Expect(matches).To(Equal(true))
}),
)
It("should return an error if the registry isn't available", func() {
It("should return false if digests differ", func() {
})
It("should return an error if the registry isn't available", func() {
})
})
When("using different registries", func() {
It("should work with DockerHub", func() {
})
When("using different registries", func() {
It("should work with DockerHub", func() {
})
It("should work with GitHub Container Registry",
SkipIfCredentialsEmpty(GHCRCredentials, func() {
fmt.Println(GHCRCredentials != nil) // to avoid crying linters
}),
)
})
It("should work with GitHub Container Registry",
SkipIfCredentialsEmpty(GHCRCredentials, func() {
fmt.Println(GHCRCredentials != nil) // to avoid crying linters
}),
)
})
})