mirror of
https://github.com/apricote/releaser-pleaser.git
synced 2026-02-08 18:57:03 +00:00
test(e2e): introduce e2e test framework with local forgejo
This commit is contained in:
parent
6ed133946e
commit
af70a267f5
4 changed files with 221 additions and 0 deletions
39
test/e2e/forgejo/framework_test.go
Normal file
39
test/e2e/forgejo/framework_test.go
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
//go:build e2e_forgejo
|
||||
|
||||
package forgejo
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
ctx := context.Background()
|
||||
|
||||
suffix := randomSuffix()
|
||||
|
||||
TestToken = setupTestUser(ctx, suffix)
|
||||
|
||||
TestClient = setupTestClient(ctx, TestToken)
|
||||
|
||||
os.Exit(m.Run())
|
||||
}
|
||||
|
||||
func TestAPIAccess(t *testing.T) {
|
||||
user, _, err := TestClient.GetMyUserInfo()
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, user)
|
||||
}
|
||||
|
||||
func TestCreateRepository(t *testing.T) {
|
||||
_ = NewRepository(t, t.Name())
|
||||
}
|
||||
|
||||
func TestRun(t *testing.T) {
|
||||
repo := NewRepository(t, t.Name())
|
||||
MustRun(t, repo, []string{})
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue