From f39d0ecfc4bfe1352f857cad022fd215c394bee2 Mon Sep 17 00:00:00 2001 From: Keepers <104464746+ryanfkeepers@users.noreply.github.com> Date: Mon, 13 Jun 2022 08:19:03 -0600 Subject: [PATCH] add repo connect s3 integration test (#192) * add repo connect s3 integration test --- .gitignore | 9 +++++---- src/pkg/repository/repository_test.go | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 627bd5335..4fe0131b6 100644 --- a/.gitignore +++ b/.gitignore @@ -11,8 +11,9 @@ # Output of the go coverage tool, specifically when used with LiteIDE *.out -# Dependency directories (remove the comment below to include it) -# vendor/ - # IDE -.vscode \ No newline at end of file +.vscode + +# Standard configuration file names +.corso_test.toml +.corso.toml \ No newline at end of file diff --git a/src/pkg/repository/repository_test.go b/src/pkg/repository/repository_test.go index df51d3d9b..23dc20b71 100644 --- a/src/pkg/repository/repository_test.go +++ b/src/pkg/repository/repository_test.go @@ -136,3 +136,21 @@ func (suite *RepositoryIntegrationSuite) TestInitialize() { }) } } + +func (suite *RepositoryIntegrationSuite) TestConnect() { + t := suite.T() + ctx := context.Background() + timeOfTest := ctesting.LogTimeOfTest(t) + prefix := "conn-s3-" + timeOfTest + + // need to initialize the repository before we can test connecting to it. + st, err := ctesting.NewS3Storage(prefix) + require.NoError(t, err) + + _, err = repository.Initialize(ctx, repository.Account{}, st) + require.NoError(t, err) + + // now re-connect + _, err = repository.Connect(ctx, repository.Account{}, st) + assert.NoError(t, err) +}