mirror of
https://github.com/apricote/releaser-pleaser.git
synced 2026-02-06 17:57:05 +00:00
test: add e2e tests with local Forgejo instance (#201)
* feat(forge): add new forge for forgejo We only support repositories hosted on Forgejo instances, but not Forgejo Actions or Woodpecker as CI solutions for now. * test(e2e): introduce e2e test framework with local forgejo
This commit is contained in:
parent
afef176e37
commit
fcf7906149
14 changed files with 936 additions and 1 deletions
39
test/e2e/forgejo/forgejo_test.go
Normal file
39
test/e2e/forgejo/forgejo_test.go
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
//go:build e2e_forgejo
|
||||
|
||||
package forgejo
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log/slog"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/apricote/releaser-pleaser/test/e2e"
|
||||
)
|
||||
|
||||
var (
|
||||
f *e2e.Framework
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
ctx := context.Background()
|
||||
|
||||
var err error
|
||||
f, err = e2e.NewFramework(ctx, &TestForge{})
|
||||
if err != nil {
|
||||
slog.Error("failed to set up test framework", "err", err)
|
||||
}
|
||||
|
||||
os.Exit(m.Run())
|
||||
}
|
||||
|
||||
func TestCreateRepository(t *testing.T) {
|
||||
_ = f.NewRepository(t, t.Name())
|
||||
}
|
||||
|
||||
func TestRun(t *testing.T) {
|
||||
repo := f.NewRepository(t, t.Name())
|
||||
require.NoError(t, f.Run(t, repo, []string{}))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue