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

Create functional test utility function to check tenant setting and retry until changed #1364

Open
2 tasks
schrolla opened this issue Oct 10, 2024 · 0 comments · May be fixed by #1448
Open
2 tasks

Create functional test utility function to check tenant setting and retry until changed #1364

schrolla opened this issue Oct 10, 2024 · 0 comments · May be fixed by #1448
Assignees
Labels
enhancement This issue or pull request will add new or improve existing functionality Testing This issue or task involves testing the automation tool function
Milestone

Comments

@schrolla
Copy link
Collaborator

💡 Summary

Some functional tests fail when a pre-condition to the test requires setting a tenant configuration value and the change is not reflected in time for the test. This results in a failed functional test that is the result of a false positive and wastes developer time verifying the results manually. The goal of this enhancement is to build a utility function that can check that a specific value has been set and wait until the change is reflected in API calls. The function should not block indefinitely, but should have a configurable timeout parameter after which it retries setting the value.
This "Set and Check" function should also be able to retry setting the tenant value after a configurable timeout and then restart its checking. Recommend defaulting the number of settings before failure to 3.
So, if you set the timeout to 10 seconds and the number of retries to 3, then the function would return with a failure after 30 seconds if the value did not change

Motivation and context

Using this function could prevent intermittent functional test failures from marking tests as failed incorrectly and provide a more stable signal of code quality back to the developers.

Implementation notes

Please provide details for implementation, such as:

  • The function should not be a core part of ScubaGear and may best be added to FunctionalTestUtils.ps1.
  • The function could take two ScriptBlocks, one to set the value and another to check it. try/catch should be used to deal with invalid script blocks and produce reasonable errors and stacktraces as feedback to users when functional tests are run.
  • The result from the function should be a boolean indicating test success or failure after all retries have been exhausted
  • Both the retry and timeout parameters should be optional with defined defaullts (recommend timeout=30 seconds, retry = 3)

Acceptance criteria

How do we know when this work is done?

@schrolla schrolla added enhancement This issue or pull request will add new or improve existing functionality Testing This issue or task involves testing the automation tool function labels Oct 10, 2024
@schrolla schrolla added this to the Kraken milestone Oct 14, 2024
@schrolla schrolla self-assigned this Oct 21, 2024
@schrolla schrolla linked a pull request Dec 2, 2024 that will close this issue
21 tasks
@schrolla schrolla linked a pull request Dec 2, 2024 that will close this issue
21 tasks
@schrolla schrolla modified the milestones: Kraken, Backlog Dec 9, 2024
@james-garriss james-garriss modified the milestones: Backlog, Lionfish Dec 9, 2024
@schrolla schrolla modified the milestones: Lionfish, Backlog Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This issue or pull request will add new or improve existing functionality Testing This issue or task involves testing the automation tool function
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants