2023-07-09 14:52:41 +02:00
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
|
|
|
|
package integration
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/url"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"code.gitea.io/gitea/modules/setting"
|
|
|
|
"code.gitea.io/gitea/modules/test"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func Test_CmdForgejo_Actions(t *testing.T) {
|
|
|
|
onGiteaRun(t, func(*testing.T, *url.URL) {
|
|
|
|
defer test.MockVariable(&setting.Actions.Enabled, true)()
|
|
|
|
|
2023-07-09 16:01:27 +02:00
|
|
|
var output string
|
|
|
|
|
|
|
|
output = cmdForgejoCaptureOutput(t, []string{"forgejo-cli", "actions", "generate-runner-token"})
|
|
|
|
assert.EqualValues(t, 40, len(output))
|
|
|
|
|
|
|
|
output = cmdForgejoCaptureOutput(t, []string{"forgejo-cli", "actions", "generate-secret"})
|
2023-07-09 14:52:41 +02:00
|
|
|
assert.EqualValues(t, 40, len(output))
|
|
|
|
})
|
|
|
|
}
|