mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-08-11 17:50:58 +00:00
refactor: remove gotest.tools
(#688)
* refactor: remove `gotest.tools` * remove all references to `gotest.tools` and replace it with `github.com/stretchr/testify` which was originally used for tests * bump `golangci-lint` version * add `depguard` and `importas` to prevent import of unwanted packages * add custom schema and information about config since schemastore.org has broken schema for `golangci-lint` config * fix: handle more error cases
This commit is contained in:
parent
ee4a5c458f
commit
e784133c16
7 changed files with 50 additions and 42 deletions
|
@ -5,7 +5,7 @@ import (
|
|||
"testing"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
"gotest.tools/v3/assert"
|
||||
assert "github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -33,7 +33,7 @@ func TestGetImagePullOptions(t *testing.T) {
|
|||
ctx := context.Background()
|
||||
|
||||
options, err := getImagePullOptions(ctx, NewDockerPullExecutorInput{})
|
||||
assert.NilError(t, err, "Failed to create ImagePullOptions")
|
||||
assert.Nil(t, err, "Failed to create ImagePullOptions")
|
||||
assert.Equal(t, options.RegistryAuth, "", "RegistryAuth should be empty if no username or password is set")
|
||||
|
||||
options, err = getImagePullOptions(ctx, NewDockerPullExecutorInput{
|
||||
|
@ -41,6 +41,6 @@ func TestGetImagePullOptions(t *testing.T) {
|
|||
Username: "username",
|
||||
Password: "password",
|
||||
})
|
||||
assert.NilError(t, err, "Failed to create ImagePullOptions")
|
||||
assert.Nil(t, err, "Failed to create ImagePullOptions")
|
||||
assert.Equal(t, options.RegistryAuth, "eyJ1c2VybmFtZSI6InVzZXJuYW1lIiwicGFzc3dvcmQiOiJwYXNzd29yZCJ9", "Username and Password should be provided")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue