Skip to content

Releases: societe-generale/spintest

Fix output issues on Rollback

04 Apr 11:35
Compare
Choose a tag to compare

Capability to use output values during a Rollback scenario

See the example, now it is working

 result = spintest(
        ["http://test.com"],
        [
            {
                "method": "GET",
                "route": "/test",
                "output": "test_output",
                "expected": {"code": 400},
                "rollback": ["test_rollback"],
            },
            {
                "name": "test_rollback",
                "method": "DELETE",
                "route": "/test/{{ test_output['id'] }}",
                "expected": {"code": 201},
            },
        ],
    )

Fail_on definition

01 Feb 21:24
Compare
Choose a tag to compare

Add capabilty to stop test execution if some elements are present on "fail_on" definition

from spintest import spintest
urls = ["https://test.com"]

tasks = [
    {
        "method": "GET",
        "route": "test",
        "expected": {
            "body": {"result": "Success"},
            "expected_match": "partial",
        },
        "fail_on": [
            {
                "code": 409,
            },
            {
                "body": {"result": "Failed"},
                "match": "partial",
            },
            {
                "body": {"result": "Error"},
                "match": "partial",
            },
        ],
        "retry": 15,
    }
]

result = spintest(urls, tasks, generate_report="report_name")
assert True is result

Generate report

26 Jun 14:36
Compare
Choose a tag to compare

Spintest is now able to generate report.

how to use it

On the spintest call, add the new argument generate_report=[PATH_OF_REPORT]

  • example
result = spintest(
      ["http://test.com"],
      [
          {"method": "GET", "route": "/test", "output": "test"},
          {"method": "GET", "route": "/{{ test['foo'] }}"},
      ],
      generate_report="/tmp/spintest_report/test_report.json",
  )
  • Report will be present on path = "/tmp/spintest_report/test_report.json"

  • Report look like :

[{"url": "http://test.com", "reports": [{"name": null, "status": "SUCCESS", "timestamp": "Fri Jun 26 14:31:05 2020", "duration_sec": 0.11, "url": "http://test.com", "route": "/test", "message": "OK.", "code": 200, "body": "Hello!", "task": {"method": "GET", "route": "/test", "delay": 1, "ignore": false, "retry": 0, "headers": {"Accept": "application/json", "Content-Type": "application/json"}, "duration_sec": 0.11}, "ignore": false, "output": {"__token__": "***"}}, {"name": null, "status": "SUCCESS", "timestamp": "Fri Jun 26 14:31:05 2020", "duration_sec": 0.11, "url": "http://test.com", "route": "/test", "message": "OK.", "code": 200, "body": "Hello!", "task": {"method": "GET", "route": "/test", "delay": 1, "ignore": false, "retry": 0, "headers": {"Accept": "application/json", "Content-Type": "application/json"}, "duration_sec": 0.11}, "ignore": false, "output": {"__token__": "***"}}], "total_duration_sec": 0.22}]

Fix test issues

26 Jun 07:33
Compare
Choose a tag to compare
v0.2.1

Bump version: 0.2.0 → 0.2.1

0.2.0

10 Feb 15:33
Compare
Choose a tag to compare

Enhancement :

  • UUID Token are not visible in the log to avoid security violation, when spintest is used during the CI/CD tools (#6)