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

ISSUE-623 : Execute specified previous steps while retrying a given step( for scenarios where current step is dependent on previous steps, such as auth) #627

Merged

Conversation

a1shadows
Copy link
Collaborator

@a1shadows a1shadows commented Feb 17, 2024

PR Branch
#ADD LINK TO THE PR BRANCH

fixes #623

Motivation and Context

The idea here is that instead of maintaining a List for ScenarioExecutionState, we will maintain a LInkedHashMap of StepExecutionState. This will make it easier to mutate ScenarioExecutionState in complex retry scenarios where previously successfully executed steps need to be re-executed (such as in the withSteps feature.

We can now run retries with previously executed steps like so:

   {
      "name" : "main",
      "url": "org.jsmart.zerocode.zerocodejavaexec.RetryTestUtility",
      "operation": "mainMethod",
      "request": "3",
      "retry": {
        "max": 3,
        "delay": 10,
        "withSteps": ["helper1","helper2", "helper3"]
      },
      "assertions": {
        "success": "true"
      }
    }

This will run the steps mentioned in withSteps in the order specified before retrying the step on failure.

Checklist:

  • Unit tests added

  • Integration tests added

  • Test names are meaningful

  • Feature manually tested

  • Branch build passed

  • No 'package.*' in the imports

  • Relevant Wiki page updated with clear instruction for the end user

    • Not applicable. This was only a refactor change, no functional or behaviour changes were introduced
  • Http test added to http-testing module(if applicable) ?

    • Not applicable. The changes did not affect HTTP automation flow
  • Kafka test added to kafka-testing module(if applicable) ?

    • Not applicable. The changes did not affect Kafka automation flow

@a1shadows a1shadows marked this pull request as ready for review February 20, 2024 10:55
@a1shadows
Copy link
Collaborator Author

@authorjapps can you review this? There are a few changes to some old constructs

import java.util.List;

@JsonInclude(JsonInclude.Include.NON_NULL)
/**
/*
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed dangling javadoc to regular comment

@a1shadows a1shadows merged commit 0fc25ff into authorjapps:master Mar 2, 2024
1 check passed
@a1shadows a1shadows deleted the issue-623/retry-from-previous branch March 14, 2024 01:57
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.

Option to retry from a previous step on failure of step
3 participants