CI/CD integration

If you want to integrate the player in a CI/CD pipeline, just use it as usual to play your script. This will create the results in the directory given by the --output-dir option. Then re-run the player in graph mode to produce a JSON document on STDOUT.

Example:

$ player inject --script /path/to/script.yml --output-dir ./results
$ player graph --script /path/to/script.yml --output-dir ./results --output-type json
Here is an excerpt of the generated JSON document:

{
    "global": {
        "total_elapsed_time": 1,
        "total_requests": 4,
        "total_network_errors": 0
    },
    "overall_stats": {
        "vu_count": {
            "0": 0
        },
        "request_count": {
            "0": 4
        },
        "latency_in_ms": {
            "0": 39
        },
        "error_count": {
            "0": 0
        },
        "network_error_count": {
            "0": 0
        },
        "received_bytes": {
            "0": 1003
        }
    },
    "latency_per_request": {
        "Action 3": {
            "0": 40
        },
        "Action 4": {
            "0": 40
        },
        "Action 1": {
            "0": 40
        },
        "Action 2": {
            "0": 39
        }
    },
    "returned_code_per_second": {
        "301": {
            "0": 4
        }
    },
    "latency_per_vu": {
        "Action 2": {
            "0": 39
        },
        "Action 3": {
            "0": 40
        },
        "Action 4": {
            "0": 40
        },
        "Action 1": {
            "0": 40
        }
    },
    "decile_per_page": {
        "Action 1": {
            "10%": 40,
            "20%": 40,
            "30%": 40,
            "40%": 40,
            "50%": 40,
            "60%": 40,
            "70%": 40,
            "80%": 40,
            "90%": 40,
            "99%": 40
        },
        "Action 2": {
            "10%": 39,
            "20%": 39,
            "30%": 39,
            "40%": 39,
            "50%": 39,
            "60%": 39,
            "70%": 39,
            "80%": 39,
            "90%": 39,
            "99%": 39
        },
        "Action 3": {
            "10%": 40,
            "20%": 40,
            "30%": 40,
            "40%": 40,
            "50%": 40,
            "60%": 40,
            "70%": 40,
            "80%": 40,
            "90%": 40,
            "99%": 40
        },
        "Action 4": {
            "10%": 40,
            "20%": 40,
            "30%": 40,
            "40%": 40,
            "50%": 40,
            "60%": 40,
            "70%": 40,
            "80%": 40,
            "90%": 40,
            "99%": 40
        }
    },
    "average_response_time_per_page": {
        "Action 1": {
            "request_count": 1,
            "average_response_time": 40,
            "average_response_size": 235
        },
        "Action 2": {
            "request_count": 1,
            "average_response_time": 39,
            "average_response_size": 244
        },
        "Action 3": {
            "request_count": 1,
            "average_response_time": 40,
            "average_response_size": 253
        },
        "Action 4": {
            "request_count": 1,
            "average_response_time": 40,
            "average_response_size": 271
        }
    },
    "returned_code_by_page": {
        "Action 1": {
            "301": 1,
            "total": 1
        },
        "Action 2": {
            "301": 1,
            "total": 1
        },
        "Action 3": {
            "301": 1,
            "total": 1
        },
        "Action 4": {
            "301": 1,
            "total": 1
        }
    }
}    
It's now up to you to parse the JSON document to check if injection was successful or not.