mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-09-13 06:17:26 +00:00
chore: prefix all Actions related integration tests with TestActions (#9035)
So they can conveniently be run all together with: `make 'test-sqlite#TestActions'` Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9035 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: Earl Warren <contact@earl-warren.org> Co-committed-by: Earl Warren <contact@earl-warren.org>
This commit is contained in:
parent
3d4536286b
commit
014bf73db8
12 changed files with 21 additions and 21 deletions
|
@ -51,7 +51,7 @@ func TestActionsAutomerge(t *testing.T) {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestForcePushCommitStatus(t *testing.T) {
|
func TestActionsForcePushCommitStatus(t *testing.T) {
|
||||||
defer unittest.OverrideFixtures("tests/integration/fixtures/TestForcePushCommitStatus/")()
|
defer unittest.OverrideFixtures("tests/integration/fixtures/TestForcePushCommitStatus/")()
|
||||||
defer tests.PrepareTestEnv(t)()
|
defer tests.PrepareTestEnv(t)()
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ import (
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestJobWithNeeds(t *testing.T) {
|
func TestActionsJobWithNeeds(t *testing.T) {
|
||||||
if !setting.Database.Type.IsSQLite3() {
|
if !setting.Database.Type.IsSQLite3() {
|
||||||
t.Skip()
|
t.Skip()
|
||||||
}
|
}
|
||||||
|
@ -174,7 +174,7 @@ jobs:
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestJobNeedsMatrix(t *testing.T) {
|
func TestActionsJobNeedsMatrix(t *testing.T) {
|
||||||
if !setting.Database.Type.IsSQLite3() {
|
if !setting.Database.Type.IsSQLite3() {
|
||||||
t.Skip()
|
t.Skip()
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ import (
|
||||||
"google.golang.org/protobuf/types/known/timestamppb"
|
"google.golang.org/protobuf/types/known/timestamppb"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestDownloadTaskLogs(t *testing.T) {
|
func TestActionsDownloadTaskLogs(t *testing.T) {
|
||||||
if !setting.Database.Type.IsSQLite3() {
|
if !setting.Database.Type.IsSQLite3() {
|
||||||
t.Skip()
|
t.Skip()
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ import (
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestActionNotifications(t *testing.T) {
|
func TestActionsNotifications(t *testing.T) {
|
||||||
if !setting.Database.Type.IsSQLite3() {
|
if !setting.Database.Type.IsSQLite3() {
|
||||||
t.Skip()
|
t.Skip()
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,7 +147,7 @@ func TestActionsWebRouteLatestRun(t *testing.T) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestActionsArtifactDeletion(t *testing.T) {
|
func TestActionsWebRouteArtifactDeletion(t *testing.T) {
|
||||||
onGiteaRun(t, func(t *testing.T, u *url.URL) {
|
onGiteaRun(t, func(t *testing.T, u *url.URL) {
|
||||||
user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2})
|
user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2})
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ import (
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestPullRequestCommitStatus(t *testing.T) {
|
func TestActionsPullRequestCommitStatus(t *testing.T) {
|
||||||
onGiteaRun(t, func(t *testing.T, u *url.URL) {
|
onGiteaRun(t, func(t *testing.T, u *url.URL) {
|
||||||
user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}) // owner of the base repo
|
user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}) // owner of the base repo
|
||||||
session := loginUser(t, "user2")
|
session := loginUser(t, "user2")
|
||||||
|
@ -350,7 +350,7 @@ jobs:
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPullRequestWithInvalidWorkflow(t *testing.T) {
|
func TestActionsPullRequestWithInvalidWorkflow(t *testing.T) {
|
||||||
onGiteaRun(t, func(t *testing.T, u *url.URL) {
|
onGiteaRun(t, func(t *testing.T, u *url.URL) {
|
||||||
user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}) // owner of the base repo
|
user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}) // owner of the base repo
|
||||||
session := loginUser(t, "user2")
|
session := loginUser(t, "user2")
|
||||||
|
@ -431,7 +431,7 @@ runs-on: docker
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPullRequestTargetEvent(t *testing.T) {
|
func TestActionsPullRequestTargetEvent(t *testing.T) {
|
||||||
onGiteaRun(t, func(t *testing.T, u *url.URL) {
|
onGiteaRun(t, func(t *testing.T, u *url.URL) {
|
||||||
user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}) // owner of the base repo
|
user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}) // owner of the base repo
|
||||||
org3 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 3}) // owner of the forked repo
|
org3 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 3}) // owner of the forked repo
|
||||||
|
@ -588,7 +588,7 @@ func TestPullRequestTargetEvent(t *testing.T) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSkipCI(t *testing.T) {
|
func TestActionsSkipCI(t *testing.T) {
|
||||||
onGiteaRun(t, func(t *testing.T, u *url.URL) {
|
onGiteaRun(t, func(t *testing.T, u *url.URL) {
|
||||||
session := loginUser(t, "user2")
|
session := loginUser(t, "user2")
|
||||||
user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2})
|
user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2})
|
||||||
|
@ -679,7 +679,7 @@ func TestSkipCI(t *testing.T) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestCreateDeleteRefEvent(t *testing.T) {
|
func TestActionsCreateDeleteRefEvent(t *testing.T) {
|
||||||
onGiteaRun(t, func(t *testing.T, u *url.URL) {
|
onGiteaRun(t, func(t *testing.T, u *url.URL) {
|
||||||
user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2})
|
user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2})
|
||||||
|
|
||||||
|
@ -795,7 +795,7 @@ func TestCreateDeleteRefEvent(t *testing.T) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestWorkflowDispatchEvent(t *testing.T) {
|
func TestActionsWorkflowDispatchEvent(t *testing.T) {
|
||||||
onGiteaRun(t, func(t *testing.T, u *url.URL) {
|
onGiteaRun(t, func(t *testing.T, u *url.URL) {
|
||||||
user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2})
|
user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2})
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ import (
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestActionVariablesModification(t *testing.T) {
|
func TestActionsVariablesModification(t *testing.T) {
|
||||||
defer unittest.OverrideFixtures("tests/integration/fixtures/TestActionVariablesModification")()
|
defer unittest.OverrideFixtures("tests/integration/fixtures/TestActionVariablesModification")()
|
||||||
defer tests.PrepareTestEnv(t)()
|
defer tests.PrepareTestEnv(t)()
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ import (
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestAPISearchActionJobs_GlobalRunner(t *testing.T) {
|
func TestActionsAPISearchActionJobs_GlobalRunner(t *testing.T) {
|
||||||
defer tests.PrepareTestEnv(t)()
|
defer tests.PrepareTestEnv(t)()
|
||||||
|
|
||||||
job := unittest.AssertExistsAndLoadBean(t, &actions_model.ActionRunJob{ID: 393})
|
job := unittest.AssertExistsAndLoadBean(t, &actions_model.ActionRunJob{ID: 393})
|
||||||
|
|
|
@ -17,7 +17,7 @@ import (
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestAPISearchActionJobs_OrgRunner(t *testing.T) {
|
func TestActionsAPISearchActionJobs_OrgRunner(t *testing.T) {
|
||||||
defer tests.PrepareTestEnv(t)()
|
defer tests.PrepareTestEnv(t)()
|
||||||
|
|
||||||
session := loginUser(t, "user1")
|
session := loginUser(t, "user1")
|
||||||
|
|
|
@ -23,7 +23,7 @@ import (
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestAPISearchActionJobs_RepoRunner(t *testing.T) {
|
func TestActionsAPISearchActionJobs_RepoRunner(t *testing.T) {
|
||||||
defer tests.PrepareTestEnv(t)()
|
defer tests.PrepareTestEnv(t)()
|
||||||
|
|
||||||
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1})
|
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1})
|
||||||
|
@ -47,7 +47,7 @@ func TestAPISearchActionJobs_RepoRunner(t *testing.T) {
|
||||||
assert.Equal(t, job.ID, jobs[0].ID)
|
assert.Equal(t, job.ID, jobs[0].ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAPIWorkflowDispatchReturnInfo(t *testing.T) {
|
func TestActionsAPIWorkflowDispatchReturnInfo(t *testing.T) {
|
||||||
onGiteaRun(t, func(t *testing.T, u *url.URL) {
|
onGiteaRun(t, func(t *testing.T, u *url.URL) {
|
||||||
workflowName := "dispatch.yml"
|
workflowName := "dispatch.yml"
|
||||||
user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2})
|
user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2})
|
||||||
|
@ -102,7 +102,7 @@ jobs:
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAPIGetListActionRun(t *testing.T) {
|
func TestActionsAPIGetListActionRun(t *testing.T) {
|
||||||
defer tests.PrepareTestEnv(t)()
|
defer tests.PrepareTestEnv(t)()
|
||||||
var (
|
var (
|
||||||
runIDs = []int64{892, 893, 894}
|
runIDs = []int64{892, 893, 894}
|
||||||
|
@ -185,7 +185,7 @@ func TestAPIGetListActionRun(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAPIGetActionRun(t *testing.T) {
|
func TestActionsAPIGetActionRun(t *testing.T) {
|
||||||
defer tests.PrepareTestEnv(t)()
|
defer tests.PrepareTestEnv(t)()
|
||||||
|
|
||||||
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 63})
|
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 63})
|
||||||
|
|
|
@ -17,7 +17,7 @@ import (
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestAPISearchActionJobs_UserRunner(t *testing.T) {
|
func TestActionsAPISearchActionJobs_UserRunner(t *testing.T) {
|
||||||
defer tests.PrepareTestEnv(t)()
|
defer tests.PrepareTestEnv(t)()
|
||||||
|
|
||||||
normalUsername := "user2"
|
normalUsername := "user2"
|
||||||
|
|
|
@ -20,7 +20,7 @@ import (
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Test_CmdForgejo_Actions(t *testing.T) {
|
func TestActions_CmdForgejo_Actions(t *testing.T) {
|
||||||
onGiteaRun(t, func(*testing.T, *url.URL) {
|
onGiteaRun(t, func(*testing.T, *url.URL) {
|
||||||
token, err := runMainApp("forgejo-cli", "actions", "generate-runner-token")
|
token, err := runMainApp("forgejo-cli", "actions", "generate-runner-token")
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue