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

(suggestion) Allow delay in non-retryable tasks #755

Open
bcecchinato opened this issue Dec 4, 2023 · 0 comments
Open

(suggestion) Allow delay in non-retryable tasks #755

bcecchinato opened this issue Dec 4, 2023 · 0 comments

Comments

@bcecchinato
Copy link

Hello !

Lots of our tests are time based, which forces us to add a lot of "sleep tests". For example, here is on of our test case :

  - name: "SPDU 20-4008 - TC03 - State"
    steps:
      - name: "Assert Output ON_CHARGE"
        type: http
        method: GET
        url: "{{ .env.gateway }}/v2/pdu/{{ .params.address }}/status"
        headers:
          Content-Type: "application/json"
          Accept: "application/json"
        ignore_verify_ssl: true
        timeout: '{{ .env.timeout }}'
        assertions:
          - result.statuscode MustEqual 200
          - result.bodyjson.board MustEqual "OK"
          - result.bodyjson.outputs.{{ .params.output }} MustEqual "ON_CHARGE"
      - name: "Assert Output Disable"
        type: http
        method: PUT
        url: "{{ .env.gateway }}/v2/pdu/{{ .params.address }}/status?output={{ .params.output }}"
        body: |
          {"enabled": false}
        headers:
          Content-Type: "application/json"
          Accept: "application/json"
        ignore_verify_ssl: true
        timeout: '{{ .env.timeout }}'
        assertions:
          - result.statuscode MustEqual 202
      - name: "Assert Wait 5s"
        type: exec
        script: sleep 5
        assertions:
          - result.code MustEqual 0
      - name: "Assert Output OFF"
        type: http
        method: GET
        url: "{{ .env.gateway }}/v2/pdu/{{ .params.address }}/status"
        headers:
          Content-Type: "application/json"
          Accept: "application/json"
        ignore_verify_ssl: true
        timeout: '{{ .env.timeout }}'
        assertions:
          - result.statuscode MustEqual 200
          - result.bodyjson.board MustEqual "OK"
          - result.bodyjson.outputs.{{ .params.output }} MustEqual "OFF"
      - name: "Assert Output Enable"
        type: http
        method: PUT
        url: "{{ .env.gateway }}/v2/pdu/{{ .params.address }}/status?output={{ .params.output }}"
        body: |
          {"enabled": true}
        headers:
          Content-Type: "application/json"
          Accept: "application/json"
        ignore_verify_ssl: true
        timeout: '{{ .env.timeout }}'
        assertions:
          - result.statuscode MustEqual 202
      - name: "Assert Wait 5s"
        type: exec
        script: sleep 5
        assertions:
          - result.code MustEqual 0
      - name: "Assert Output ON_CHARGE"
        type: http
        method: GET
        url: "{{ .env.gateway }}/v2/pdu/{{ .params.address }}/status"
        headers:
          Content-Type: "application/json"
          Accept: "application/json"
        ignore_verify_ssl: true
        timeout: '{{ .env.timeout }}'
        assertions:
          - result.statuscode MustEqual 200
          - result.bodyjson.board MustEqual "OK"
          - result.bodyjson.outputs.{{ .params.output }} MustEqual "ON_CHARGE"

The delay is only used in case of a retryable test. Would it be possible to use the delay in case of non-retryable test. It would then be possible to remove a lot of unecessary tests like our "Assert Wait Xs".

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

No branches or pull requests

1 participant