hashicorp / terraform-provider-runscope

Terraform runscope provider. Please note: This Terraform provider is archived per our provider archiving process: https://terraform.io/docs/internals/archiving.html
https://www.terraform.io/docs/providers/runscope/
Other
8 stars 25 forks source link

Changes to scripts and before_scripts not applied #32

Open damirfilipovic opened 4 years ago

damirfilipovic commented 4 years ago

In the test step properties before_scripts and scripts, changes to the values are not applied when applying the plan. Unless a new resource is being created from scratch.

The workaround is to destroy the resources and reapply, but then the test history is lost.

damirfilipovic commented 4 years ago

After further investigation I've observed that this only happens when no other property has been updated in said resource (i.e. test step), so a better workaround is to introduce a nonsense variable (whatever isn't actually used in the test step) that assumes a unique name on every plan. For example:

  variables {
      name     = "${uuid()}"
      source   = "response_header"
      property = "Date"
    }
toxic-johann commented 4 years ago

I have met the same problems too. I want to change the name of the test, but I can't do that until I change the description together. So I do such a workaround as you have done.

resource "runscope_test" "uptime-check" {
  name        = "xxxx"
  description = "${timestamp()}"
  bucket_id   = "${local.bucket_id}"
}