Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

test: Test skeleton diagram and integrations tests for module vmseries #280

Merged
merged 13 commits into from
Feb 2, 2023

Conversation

sebastianczech
Copy link
Contributor

@sebastianczech sebastianczech commented Jan 25, 2023

Description

PR delivers integrations tests for vmseries module and additional diagram (as a code) presenting how test skeleton works:

graph TB
    terraform_options(Init Terraform with provided options)
    terraform_apply(Deploy infrastructure)
    do_terraform_plan_after_deploy{Execute Terraform Plan?}
    terraform_plan_after_deploy(Verify if no changes are planned after deployment)
    do_modify_infrastructure{Modify infrastructure?}
    modify_infrastructure(Plan infrastructure with changed resources)
    verify_changes(Verify planned changes)
    terraform_apply_changes(Deploy infrastructure with changed resources)
    verify_assert_expression(Verify assert expressions)
    terraform_destroy(Destroy infrastructure)
    test_fail((Tests failed))
    test_pass((Tests passed))

    terraform_options --> terraform_apply -- infrastructure is deployed --> verify_assert_expression
    do_terraform_plan_after_deploy -- yes --> terraform_plan_after_deploy
    terraform_plan_after_deploy -- code is idempotent --> do_modify_infrastructure
    verify_assert_expression -- all asserts passed --> do_terraform_plan_after_deploy
    do_modify_infrastructure -- yes --> modify_infrastructure --> verify_changes
    verify_changes -- only expected changes --> terraform_apply_changes
    terraform_apply -. error in deployment .-> test_fail
    terraform_plan_after_deploy -. code is not idempotent .-> test_fail
    verify_assert_expression -. one of the asserts failed .-> test_fail
    verify_changes -. unexpected changes .-> test_fail
    terraform_apply_changes -. error in deployment .-> test_fail
    do_terraform_plan_after_deploy -- no --> test_pass
    do_modify_infrastructure -- no --> test_pass
    terraform_apply_changes -- infrastructure is deployed --> test_pass
    test_fail -..-> terraform_destroy
    test_pass ----> terraform_destroy

    classDef green fill:#33aa33,stroke:#333,stroke-width:2px;
    classDef red fill:#aa3333,stroke:#333,stroke-width:2px;
    class test_pass green
    class test_fail red
Loading

Motivation and Context

#261

How Has This Been Tested?

Code was tested by Terratest.

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes if appropriate.
  • All new and existing tests passed.

@sebastianczech sebastianczech changed the title Test vmseries 261 test: Integrations tests for module vmseries Jan 25, 2023
@sebastianczech sebastianczech marked this pull request as ready for review January 27, 2023 13:54
@sebastianczech sebastianczech requested a review from a team as a code owner January 27, 2023 13:54
@sebastianczech sebastianczech changed the title test: Integrations tests for module vmseries test: Test skeleton diagram and integrations tests for module vmseries Jan 27, 2023
@sebastianczech sebastianczech merged commit 32999e3 into test-skeleton-165 Feb 2, 2023
@sebastianczech sebastianczech deleted the test-vmseries-261 branch February 2, 2023 07:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants