Skip to content
This repository has been archived by the owner on Dec 9, 2020. It is now read-only.

Ruscope test steps order #26

Open
taraspos opened this issue May 31, 2019 · 1 comment
Open

Ruscope test steps order #26

taraspos opened this issue May 31, 2019 · 1 comment

Comments

@taraspos
Copy link

Hey,
today I faced the issue, that there is no way to define the order of the steps. And since runscope test steps can depend on each other, therefore the order is important.

Directive depends_on can be used to chain the dependency between tests and it works fine until you need to insert a new test between the existing ones and that doesn't work, because terraform will simply create the new test as last one.

The workaround I figured is to state the test order in the resources name and chain dependencies between each other like:

resource "runscope_step" "create_test_01" {
    depends_on = ["runscope_step.test00"]
    ...
}

resource "runscope_step" "delete_test_02" {
    depends_on = ["runscope_step.create_test_01"]
    ...
}

# ... etc, etc

The serious drawback of such approach is if I want to put the update_test_02 between these two, I would need to rename all the tests after this one, incrementing the order in the resource name like:

resource "runscope_step" "create_test_01" {
    depends_on = ["runscope_step.test00"]
    ...
}

resource "runscope_step" "update_test_02" {
    depends_on = ["runscope_step.create_test_01"]
    ...
}

resource "runscope_step" "delete_test_03" {
    depends_on = ["runscope_step.update_test_02"]
    ...
}

# ... etc, etc

In this case, terraform will remove all the test steps whose names were changed and create them in the correct order. But updating manually the name of all the test isn't a good option.

Do you have any ideas how that can be resolved?

The only viable idea I have is to introduce a new resource type called runscope_steps which actually takes the array of steps and preserves the order.

@wolf31o2
Copy link

See #18 for an implementation of this

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants