SnykTestJob

Model for Snyk Test Job.

  1. Overview

Overview

This model represents a test job that tracks the status of an asynchronous test. Tests are created via the Test API and their status can be polled using this endpoint. Uses the Snyk v2 REST API endpoint: /orgs/{org_id}/test_jobs/{job_id}

import clearskies
from clearskies_snyk.models import SnykTestJob


def my_handler(snyk_test_job: SnykTestJob):
    # Get test job status
    job = snyk_test_job.find("org_id=org-123&job_id=job-456")
    print(f"Job status: {job.status}")
    if job.status == "finished":
        print(f"Test ID: {job.test_id}")