Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add terraform related test cases #979

Merged
merged 4 commits into from
Nov 27, 2023
Merged

Conversation

lanfon72
Copy link
Member

@lanfon72 lanfon72 commented Nov 2, 2023

Changes

  • NEW Test cases
    • test_create_image for legacy test_create_images_using_terraform
    • test_delete_image
    • test_create_volume_from_image for legacy test_create_vol_with_image_terraform
    • TestNetworking for legacy test_create_network_using_terraform
      • including create/delete cluster network, cluster config and VM network
  • REMOVE file integration/test_terraform.py whcih been replaced with integration/test_z_terraform.py
  • UPDATE Improve fixtures and classes in fixtures/terraform.py
    • Move out TerraformHarvester ResourceContext, and TerraformResource to module scope
    • Add raw field for ResourceContext
    • Restructure TerraformResource into version-based: BaseTerraformResource for basic functionality, and other inherited classes for resources introduced from specific version.

All Harvester terraform resources (image, volume, ssh_key, network, vlanconfig, clusternetwork, storageclass, virtualmachine and cloudinit_secret) has been implemented, but storageclass and VM related test cases are not implemented in this PR.

@lanfon72 lanfon72 force-pushed the terraform branch 2 times, most recently from 36b1da9 to 7b7a406 Compare November 14, 2023 17:17
@lanfon72
Copy link
Member Author

lanfon72 commented Nov 14, 2023

tested on harvester-runtests#409

delete image will always failed which might have some timing issue; and delete clusternetwork will occasionally hit same problem.

Copy link
Contributor

@albinsun albinsun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pytest.fixture(scope="module")
def image_resource(unique_name, image_opensuse, tf_resource):
spec = tf_resource.image_download(
f"tf_{unique_name}", unique_name, unique_name, image_opensuse.url
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider make prefix "tf_" a variable to reuse.

@lanfon72 lanfon72 merged commit fa44a0f into harvester:main Nov 27, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants