chore: add tests
[skip ci]
This commit is contained in:
parent
ff144042ba
commit
b06e7ffd40
4 changed files with 56 additions and 2 deletions
4
.github/workflows/clean_up.yaml
vendored
4
.github/workflows/clean_up.yaml
vendored
|
|
@ -41,13 +41,13 @@ jobs:
|
||||||
webhookUrl: '${{ secrets.GOOGLE_WEBHOOK_URL }}'
|
webhookUrl: '${{ secrets.GOOGLE_WEBHOOK_URL }}'
|
||||||
jobStatus: '${{ job.status }}'
|
jobStatus: '${{ job.status }}'
|
||||||
title: CLEAN-UP pipeline
|
title: CLEAN-UP pipeline
|
||||||
subtitle: "${{ github.event_name }} with filter prefix <b>${{ inputs.res_prefix }}</b>"
|
subtitle: "${{ github.event_name }} with filter prefix \"${{ inputs.res_prefix }}\""
|
||||||
|
|
||||||
# - name: Notify
|
# - name: Notify
|
||||||
# uses: ./.github/actions/notify
|
# uses: ./.github/actions/notify
|
||||||
# with:
|
# with:
|
||||||
# webhook_url: ${{ secrets.GOOGLE_WEBHOOK_URL }}
|
# webhook_url: ${{ secrets.GOOGLE_WEBHOOK_URL }}
|
||||||
# title: CI pipeline started
|
# title: CLEAN-UP pipeline
|
||||||
# event_title: ${{ github.event.type }}
|
# event_title: ${{ github.event.type }}
|
||||||
# event_author: ${{ github.event.actor.login }}
|
# event_author: ${{ github.event.actor.login }}
|
||||||
# event_body: "Filter: ${{ inputs.res_prefix }}"
|
# event_body: "Filter: ${{ inputs.res_prefix }}"
|
||||||
|
|
|
||||||
17
.github/workflows/tf-acc-test.yaml
vendored
17
.github/workflows/tf-acc-test.yaml
vendored
|
|
@ -30,6 +30,14 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Notify Google Chat
|
||||||
|
if: ${{ always() }} # Use always to ensure that the notification is also send on failure of former steps
|
||||||
|
uses: SimonScholz/google-chat-action@main
|
||||||
|
with:
|
||||||
|
webhookUrl: '${{ secrets.GOOGLE_WEBHOOK_URL }}'
|
||||||
|
title: Acceptance Tests started
|
||||||
|
subtitle: "${{ github.event_name }}"
|
||||||
|
|
||||||
- name: Notify
|
- name: Notify
|
||||||
uses: ./.github/actions/notify
|
uses: ./.github/actions/notify
|
||||||
with:
|
with:
|
||||||
|
|
@ -71,6 +79,15 @@ jobs:
|
||||||
tf_acc_kek_key_version: ${{ vars.TF_ACC_KEK_KEY_VERSION }}
|
tf_acc_kek_key_version: ${{ vars.TF_ACC_KEK_KEY_VERSION }}
|
||||||
tf_acc_kek_service_account: ${{ vars.TF_ACC_KEK_SERVICE_ACCOUNT }}
|
tf_acc_kek_service_account: ${{ vars.TF_ACC_KEK_SERVICE_ACCOUNT }}
|
||||||
|
|
||||||
|
- name: Notify Google Chat
|
||||||
|
if: ${{ always() }} # Use always to ensure that the notification is also send on failure of former steps
|
||||||
|
uses: SimonScholz/google-chat-action@main
|
||||||
|
with:
|
||||||
|
webhookUrl: '${{ secrets.GOOGLE_WEBHOOK_URL }}'
|
||||||
|
jobStatus: '${{ job.status }}'
|
||||||
|
title: Acceptance Tests started
|
||||||
|
subtitle: "${{ github.event_name }} finished"
|
||||||
|
|
||||||
- name: Notify
|
- name: Notify
|
||||||
uses: ./.github/actions/notify
|
uses: ./.github/actions/notify
|
||||||
with:
|
with:
|
||||||
|
|
|
||||||
|
|
@ -157,6 +157,9 @@ func TestAccInstance(t *testing.T) {
|
||||||
updVersion := updNetACL
|
updVersion := updNetACL
|
||||||
updVersion.Version = "17"
|
updVersion.Version = "17"
|
||||||
|
|
||||||
|
updRetention := updVersion
|
||||||
|
updRetention.RetentionDays = 40
|
||||||
|
|
||||||
testItemID := testutils.ResStr(pfx, "instance", exData.TfName)
|
testItemID := testutils.ResStr(pfx, "instance", exData.TfName)
|
||||||
compareValuesSame := statecheck.CompareValue(compare.ValuesSame())
|
compareValuesSame := statecheck.CompareValue(compare.ValuesSame())
|
||||||
resource.ParallelTest(
|
resource.ParallelTest(
|
||||||
|
|
@ -337,6 +340,23 @@ func TestAccInstance(t *testing.T) {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
// Update retention_days
|
||||||
|
{
|
||||||
|
PreConfig: func() {
|
||||||
|
t.Logf(" ... %s - %s", t.Name(), "update version")
|
||||||
|
},
|
||||||
|
Config: testutils.StringFromTemplateMust(
|
||||||
|
"testdata/instance_template.gompl",
|
||||||
|
updVersion,
|
||||||
|
),
|
||||||
|
Check: resource.ComposeTestCheckFunc(
|
||||||
|
resource.TestCheckResourceAttr(
|
||||||
|
testItemID,
|
||||||
|
"retention_days",
|
||||||
|
strconv.Itoa(int(updVersion.RetentionDays)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
},
|
||||||
// Import test
|
// Import test
|
||||||
// test instance imports
|
// test instance imports
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -142,6 +142,9 @@ func TestAccInstance(t *testing.T) {
|
||||||
updSizeData := exData
|
updSizeData := exData
|
||||||
updSizeData.Size = 25
|
updSizeData.Size = 25
|
||||||
|
|
||||||
|
updRetentionDays := updSizeData
|
||||||
|
updRetentionDays.RetentionDays = 30
|
||||||
|
|
||||||
testInstanceID := testutils.ResStr(pfx, "instance", exData.TfName)
|
testInstanceID := testutils.ResStr(pfx, "instance", exData.TfName)
|
||||||
|
|
||||||
compareValuesSame := statecheck.CompareValue(compare.ValuesSame())
|
compareValuesSame := statecheck.CompareValue(compare.ValuesSame())
|
||||||
|
|
@ -210,6 +213,20 @@ func TestAccInstance(t *testing.T) {
|
||||||
defaultNoEncInstanceTestChecks(testInstanceID, updSizeData),
|
defaultNoEncInstanceTestChecks(testInstanceID, updSizeData),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
// Update retention_days
|
||||||
|
{
|
||||||
|
PreConfig: func() {
|
||||||
|
t.Logf("testing: %s - %s", t.Name(), "update storage.retention_days and verify")
|
||||||
|
},
|
||||||
|
ExpectNonEmptyPlan: true,
|
||||||
|
Config: testutils.StringFromTemplateMust(
|
||||||
|
"testdata/instance_template.gompl",
|
||||||
|
updRetentionDays,
|
||||||
|
),
|
||||||
|
Check: resource.ComposeTestCheckFunc(
|
||||||
|
defaultNoEncInstanceTestChecks(testInstanceID, updRetentionDays),
|
||||||
|
),
|
||||||
|
},
|
||||||
// Import test
|
// Import test
|
||||||
// test instance imports
|
// test instance imports
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue