def METHOD_NAME(name):
    spec = request.args.get('spec')
    if spec is None:
        return bad_request("No test spec provided")
    try:
        returncode, stdout, stderr = pscheduler.plugin_invoke(
            "test", name, "participants",
            stdin=spec,
            )
    except KeyError:
        return bad_request("Invalid spec")
    except Exception as ex:
        return bad_request(ex)
    if returncode != 0:
        return bad_request(stderr)
    # If this fails because of bad JSON, an exception will be thrown,
    # caught and logged.
    return ok_json(pscheduler.json_load(stdout, max_schema=1), sanitize=False)