- Introduced a new `.env.test.example` file for integration test configuration. - Added a `Makefile` to streamline test commands for unit and integration tests. - Implemented an integration testing harness with support for PostgreSQL, MinIO, and Redis using testcontainers. - Created a suite of integration tests covering health checks and user management functionalities. - Enhanced CI workflow to include integration tests with necessary environment variables.
46 lines
1.3 KiB
Go
46 lines
1.3 KiB
Go
//go:build integration
|
|
|
|
package suite_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/ultisuite/ulti-backend/internal/integrationtest"
|
|
)
|
|
|
|
func TestDriveQuotaOptional(t *testing.T) {
|
|
integrationtest.SkipUnlessNextcloud(t)
|
|
h := integrationtest.RequireHarness(t)
|
|
client, _ := integrationtest.RequireUserClient(t, h)
|
|
|
|
resp, err := client.Get("/api/v1/drive/quota")
|
|
integrationtest.FailIf(err, t, "drive quota")
|
|
if resp.Status != 200 && resp.Status != 502 && resp.Status != 503 {
|
|
t.Fatalf("status = %d, body = %s", resp.Status, string(resp.Body))
|
|
}
|
|
}
|
|
|
|
func TestPhotosAssetsOptional(t *testing.T) {
|
|
integrationtest.SkipUnlessImmich(t)
|
|
h := integrationtest.RequireHarness(t)
|
|
client, _ := integrationtest.RequireUserClient(t, h)
|
|
|
|
resp, err := client.Get("/api/v1/photos/assets?page=1&size=1")
|
|
integrationtest.FailIf(err, t, "photos assets")
|
|
if resp.Status != 200 && resp.Status != 502 && resp.Status != 503 {
|
|
t.Fatalf("status = %d, body = %s", resp.Status, string(resp.Body))
|
|
}
|
|
}
|
|
|
|
func TestMeetRoomOptional(t *testing.T) {
|
|
integrationtest.SkipUnlessJitsi(t)
|
|
h := integrationtest.RequireHarness(t)
|
|
client, _ := integrationtest.RequireUserClient(t, h)
|
|
|
|
resp, err := client.Post("/api/v1/meet/rooms", map[string]string{
|
|
"subject": "Integration test room",
|
|
})
|
|
integrationtest.FailIf(err, t, "create meet room")
|
|
integrationtest.FailUnlessStatus(t, resp, 201)
|
|
}
|