From 82e15dc6dc85e4d02eb7eabbb3c53d87383e9e04 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sun, 14 May 2017 00:29:10 +0200 Subject: [PATCH] Allow skipping the test against s3 If RESTIC_TEST_S3_REPOSITORY is not available it means we're probably running on Travis for a third-party PR, so the access credentials for S3 are not exposed. --- run_integration_tests.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/run_integration_tests.go b/run_integration_tests.go index f820d49a9..eca5ed82f 100644 --- a/run_integration_tests.go +++ b/run_integration_tests.go @@ -155,8 +155,15 @@ func (env *TravisEnvironment) RunTests() error { "restic/backend/rest.TestBackendREST", "restic/backend/sftp.TestBackendSFTP", "restic/backend/s3.TestBackendMinio", - "restic/backend/s3.TestBackendS3", } + + // if the test s3 repository is available, make sure that the test is not skipped + if os.Getenv("RESTIC_TEST_S3_REPOSITORY") != "" { + ensureTests = append(ensureTests, "restic/backend/s3.TestBackendS3") + } else { + msg("S3 repository not available\n") + } + env.env["RESTIC_TEST_DISALLOW_SKIP"] = strings.Join(ensureTests, ",") if *runCrossCompile {