From c9b355319fb9e9adddf34850a179d45478c91b29 Mon Sep 17 00:00:00 2001 From: Naama Bendalak <74866605+8naama@users.noreply.github.com> Date: Sun, 21 Jul 2024 14:28:19 +0300 Subject: [PATCH] dev work update tests (#125) --- .github/workflows/test-daily.yml | 6 +++--- .github/workflows/tests.yml | 6 +++--- .../metrics_account_create_integration_test.go | 9 +++++++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-daily.yml b/.github/workflows/test-daily.yml index bf4537a..dcee301 100644 --- a/.github/workflows/test-daily.yml +++ b/.github/workflows/test-daily.yml @@ -29,11 +29,11 @@ jobs: name: Test runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: 1.18 + go-version: 1.22 - name: Test # We exclude kibana_objects tests run: go test $(go list ./... | grep -v kibana_objects) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index acc9e88..953d11e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -26,11 +26,11 @@ jobs: name: Test runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: - go-version: 1.18 + go-version: 1.22 - name: Before install run: | go get golang.org/x/tools/cmd/cover diff --git a/metrics_accounts/metrics_account_create_integration_test.go b/metrics_accounts/metrics_account_create_integration_test.go index 47dc940..3849578 100644 --- a/metrics_accounts/metrics_account_create_integration_test.go +++ b/metrics_accounts/metrics_account_create_integration_test.go @@ -76,7 +76,12 @@ func TestIntegrationMetricsAccount_CreateMetricsAccountNoAccountName(t *testing. createMetricsAccount.AccountName = "" metricsAccount, err := underTest.CreateMetricsAccount(createMetricsAccount) - assert.Error(t, err) - assert.Nil(t, metricsAccount) + if assert.NoError(t, err) && assert.NotNil(t, metricsAccount) { + time.Sleep(4 * time.Second) + defer underTest.DeleteMetricsAccount(int64(metricsAccount.Id)) + assert.NotEmpty(t, metricsAccount.Token) + assert.NotEmpty(t, metricsAccount.Id) + assert.Equal(t, metricsAccount.AccountName, "IntegrationsTeamTesting_metrics") + } } }