mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-21 08:31:27 -05:00
chore: Fix a few lint errors
- Adjust `PrepareArtifactsStorage` to use `require.NoError` instead of `assert.NoError` - Adjust `TestActionsArtifactDownload` to have the proper order of `assert.Equal` arguments. Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
This commit is contained in:
parent
268276d4a7
commit
ae6292ba38
2 changed files with 4 additions and 4 deletions
|
@ -126,7 +126,7 @@ func TestActionsArtifactDownload(t *testing.T) {
|
|||
}
|
||||
}
|
||||
assert.NotNil(t, artifactIdx)
|
||||
assert.Equal(t, listResp.Value[artifactIdx].Name, "artifact-download")
|
||||
assert.Equal(t, "artifact-download", listResp.Value[artifactIdx].Name)
|
||||
assert.Contains(t, listResp.Value[artifactIdx].FileContainerResourceURL, "/api/actions_pipeline/_apis/pipelines/workflows/791/artifacts")
|
||||
|
||||
idx := strings.Index(listResp.Value[artifactIdx].FileContainerResourceURL, "/api/actions_pipeline/_apis/pipelines/")
|
||||
|
|
|
@ -226,13 +226,13 @@ func cancelProcesses(t testing.TB, delay time.Duration) {
|
|||
|
||||
func PrepareArtifactsStorage(t testing.TB) {
|
||||
// prepare actions artifacts directory and files
|
||||
assert.NoError(t, storage.Clean(storage.ActionsArtifacts))
|
||||
require.NoError(t, storage.Clean(storage.ActionsArtifacts))
|
||||
|
||||
s, err := storage.NewStorage(setting.LocalStorageType, &setting.Storage{
|
||||
Path: filepath.Join(filepath.Dir(setting.AppPath), "tests", "testdata", "data", "artifacts"),
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
assert.NoError(t, s.IterateObjects("", func(p string, obj storage.Object) error {
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, s.IterateObjects("", func(p string, obj storage.Object) error {
|
||||
_, err = storage.Copy(storage.ActionsArtifacts, p, s, p)
|
||||
return err
|
||||
}))
|
||||
|
|
Loading…
Reference in a new issue