Compare commits

...
Sign in to create a new pull request.

3 commits

Author SHA1 Message Date
Marcel S. Henselin
b06e7ffd40 chore: add tests
[skip ci]
2026-03-25 16:53:23 +01:00
Marcel S. Henselin
ff144042ba chore: add notifications
[skip ci]
2026-03-25 13:56:44 +01:00
Marcel S. Henselin
413dbd6f50 chore: add notifications
[skip ci]
2026-03-25 13:52:47 +01:00
6 changed files with 91 additions and 11 deletions

View file

@ -214,7 +214,7 @@ runs:
TF_ACC_KEK_KEY_RING_ID=${TF_ACC_KEK_KEY_RING_ID} \ TF_ACC_KEK_KEY_RING_ID=${TF_ACC_KEK_KEY_RING_ID} \
TF_ACC_KEK_KEY_VERSION=${TF_ACC_KEK_KEY_VERSION} \ TF_ACC_KEK_KEY_VERSION=${TF_ACC_KEK_KEY_VERSION} \
TF_ACC_KEK_SERVICE_ACCOUNT=${TF_ACC_KEK_SERVICE_ACCOUNT} \ TF_ACC_KEK_SERVICE_ACCOUNT=${TF_ACC_KEK_SERVICE_ACCOUNT} \
go test -v ${{ inputs.test_file }} -timeout=${{ inputs.test_timeout_string }} go test -v ${{ inputs.test_file }} -timeout=${{ inputs.test_timeout_string }} | tee -a acc_test_run.log
echo "::endgroup::" echo "::endgroup::"
env: env:
TF_ACC_PROJECT_ID: ${{ inputs.project_id }} TF_ACC_PROJECT_ID: ${{ inputs.project_id }}
@ -243,7 +243,7 @@ runs:
# testArguments: "./... -timeout ${{ inputs.test_timeout_string }}" # testArguments: "./... -timeout ${{ inputs.test_timeout_string }}"
# moduleDirectory: "stackit" # moduleDirectory: "stackit"
- name: Run acceptance tests - name: Run all acceptance tests
if: ${{ inputs.test_file == '' }} if: ${{ inputs.test_file == '' }}
shell: bash shell: bash
run: | run: |

View file

@ -33,6 +33,23 @@ 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 }}'
jobStatus: '${{ job.status }}'
title: CI pipeline
subtitle: "on: ${{ github.event_name }}"
#imageUrl: https://raw.githubusercontent.com/SimonScholz/simonscholz.github.io/gatsby-homepage/src/assets/img/avatar.webp
#imageType: SQUARE
#imageAltText: Alternative image text
#createDefaultSection: false
#collapsibleDefaultSection: false
#uncollapsibleWidgetsCount: 3
#additionalSections: '[{"header": "Additional Section", "collapsible": true, "widgets": [{"decoratedText": {"startIcon": {"knownIcon": "STAR"},"text": "Additional Section"}}] }]'
#threadKey: ${{ github.event.number }}
- name: Notify - name: Notify
uses: ./.github/actions/notify uses: ./.github/actions/notify
with: with:

View file

@ -34,16 +34,25 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v6 uses: actions/checkout@v6
- name: Notify - name: Notify Google Chat
uses: ./.github/actions/notify if: ${{ always() }} # Use always to ensure that the notification is also send on failure of former steps
uses: SimonScholz/google-chat-action@main
with: with:
webhook_url: ${{ secrets.GOOGLE_WEBHOOK_URL }} webhookUrl: '${{ secrets.GOOGLE_WEBHOOK_URL }}'
title: CI pipeline started jobStatus: '${{ job.status }}'
event_title: ${{ github.event.type }} title: CLEAN-UP pipeline
event_author: ${{ github.event.actor.login }} subtitle: "${{ github.event_name }} with filter prefix \"${{ inputs.res_prefix }}\""
event_body: "Filter: ${{ inputs.res_prefix }}"
event_number: ${{ github.event.id }} # - name: Notify
event_url: "https://tf-provider.git.onstackit.cloud/stackit-dev-tools/terraform-provider-stackitprivatepreview/actions/runs/${{ github.run_id }}" # uses: ./.github/actions/notify
# with:
# webhook_url: ${{ secrets.GOOGLE_WEBHOOK_URL }}
# title: CLEAN-UP pipeline
# event_title: ${{ github.event.type }}
# event_author: ${{ github.event.actor.login }}
# event_body: "Filter: ${{ inputs.res_prefix }}"
# event_number: ${{ github.event.id }}
# event_url: "https://tf-provider.git.onstackit.cloud/stackit-dev-tools/terraform-provider-stackitprivatepreview/actions/runs/${{ github.run_id }}"
- name: Clean - name: Clean
uses: ./.github/actions/clean_up uses: ./.github/actions/clean_up

View file

@ -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:

View file

@ -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
{ {

View file

@ -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
{ {