From 49cab2b01fc40c04dbd847e12a76516ced6b29b5 Mon Sep 17 00:00:00 2001 From: singuliere <35190819+singuliere@users.noreply.github.com> Date: Fri, 25 Feb 2022 10:20:50 +0100 Subject: migrations: add test for importing pull requests in gitea uploader (#18752) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * logs: add the buffer logger to inspect logs during testing Signed-off-by: Loïc Dachary * migrations: add test for importing pull requests in gitea uploader Signed-off-by: Loïc Dachary * for each git.OpenRepositoryCtx, call Close * Content is expected to return the content of the log * test for errors before defer Co-authored-by: Loïc Dachary Co-authored-by: zeripath Co-authored-by: Lunny Xiao --- models/migrations/testlogger_test.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'models/migrations') diff --git a/models/migrations/testlogger_test.go b/models/migrations/testlogger_test.go index 01d6b7a0f7..c087e311c2 100644 --- a/models/migrations/testlogger_test.go +++ b/models/migrations/testlogger_test.go @@ -166,6 +166,11 @@ func (log *TestLogger) Init(config string) error { return nil } +// Content returns the content accumulated in the content provider +func (log *TestLogger) Content() (string, error) { + return "", fmt.Errorf("not supported") +} + // Flush when log should be flushed func (log *TestLogger) Flush() { } -- cgit v1.2.3