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_VERSION=${TF_ACC_KEK_KEY_VERSION} \
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::"
env:
TF_ACC_PROJECT_ID: ${{ inputs.project_id }}
@ -243,7 +243,7 @@ runs:
# testArguments: "./... -timeout ${{ inputs.test_timeout_string }}"
# moduleDirectory: "stackit"
- name: Run acceptance tests
- name: Run all acceptance tests
if: ${{ inputs.test_file == '' }}
shell: bash
run: |

View file

@ -33,6 +33,23 @@ jobs:
- name: Checkout
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
uses: ./.github/actions/notify
with:

View file

@ -34,16 +34,25 @@ jobs:
- name: Checkout
uses: actions/checkout@v6
- name: Notify
uses: ./.github/actions/notify
- 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:
webhook_url: ${{ secrets.GOOGLE_WEBHOOK_URL }}
title: CI pipeline started
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 }}"
webhookUrl: '${{ secrets.GOOGLE_WEBHOOK_URL }}'
jobStatus: '${{ job.status }}'
title: CLEAN-UP pipeline
subtitle: "${{ github.event_name }} with filter prefix \"${{ inputs.res_prefix }}\""
# - name: Notify
# 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
uses: ./.github/actions/clean_up

View file

@ -30,6 +30,14 @@ jobs:
- name: Checkout
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
uses: ./.github/actions/notify
with:
@ -71,6 +79,15 @@ jobs:
tf_acc_kek_key_version: ${{ vars.TF_ACC_KEK_KEY_VERSION }}
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
uses: ./.github/actions/notify
with:

View file

@ -157,6 +157,9 @@ func TestAccInstance(t *testing.T) {
updVersion := updNetACL
updVersion.Version = "17"
updRetention := updVersion
updRetention.RetentionDays = 40
testItemID := testutils.ResStr(pfx, "instance", exData.TfName)
compareValuesSame := statecheck.CompareValue(compare.ValuesSame())
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
// test instance imports
{

View file

@ -142,6 +142,9 @@ func TestAccInstance(t *testing.T) {
updSizeData := exData
updSizeData.Size = 25
updRetentionDays := updSizeData
updRetentionDays.RetentionDays = 30
testInstanceID := testutils.ResStr(pfx, "instance", exData.TfName)
compareValuesSame := statecheck.CompareValue(compare.ValuesSame())
@ -210,6 +213,20 @@ func TestAccInstance(t *testing.T) {
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
// test instance imports
{