harvester / tests

Harvester test cases
Apache License 2.0
10 stars 31 forks source link

[TEST] Fix test_z_terraform.py::test_create_ssh_key::setup #1465

Open albinsun opened 1 month ago

albinsun commented 1 month ago

What's the test to develop? Please describe

Prerequisite and dependency of test

Additional context

lanfon72 commented 1 month ago

The bug introduced from #1421, the original idea that we should use latest version for 0.0.0-dev to get correct sub class (TerraformResource_063), but still need to write 0.0.0-dev in provider.tf.

The fix #1421 did let us to get correct sub class, but the provider.tf still wrote latest version 0.6.4 as its version; then when we try to install 0.6.4 as the provider, terraform will try to search whether the global path ~/.terraform/plugins/... contains it, and as we were put 0.0.0-dev in the folder, so the installation will fail. (as the snapshot you provided.)

To fix this, we have several things need to do:

  1. Make sure we can get latest sub class and use 0.0.0-dev as the version if user provided it.
  2. Remove the global installed 0.0.0-dev (I had removed it)
  3. When user use 0.0.0-dev, DO NOT install it to global path, we can use terraform init -plugin-dir as the alternative path