async def METHOD_NAME(server, client, env_with_compiles):
    environment, ids, compile_requested_timestamps = env_with_compiles
    # A compile that has no substitute_compile_id, and has reports
    result = await client.compile_details(environment, ids[0])
    assert result.code == 200
    reports = result.result["data"]["reports"]
    assert len(reports) == 2
    assert parse_datetime_to_utc(reports[0]["started"]) < parse_datetime_to_utc(reports[1]["started"])
    assert uuid.UUID(result.result["data"]["id"]) == ids[0]
    assert parse_datetime_to_utc(result.result["data"]["requested"]) == compile_requested_timestamps[0].astimezone(
        datetime.timezone.utc
    )
    # A compile that is 2 levels deep in substitutions: id2 -> id1 -> id0
    result = await client.compile_details(environment, ids[2])
    assert result.code == 200
    substituted_reports = result.result["data"]["reports"]
    assert len(substituted_reports) == 2
    assert substituted_reports == reports
    assert uuid.UUID(result.result["data"]["id"]) == ids[2]
    assert datetime.datetime.strptime(result.result["data"]["requested"], "%Y-%m-%dT%H:%M:%S.%f").replace(
        tzinfo=datetime.timezone.utc
    ) == compile_requested_timestamps[2].astimezone(datetime.timezone.utc)
    # A compile that has no reports
    result = await client.compile_details(environment, ids[3])
    assert result.code == 200
    assert not result.result["data"]["reports"]
    # An id that doesn't exist as a compile
    result = await client.compile_details(environment, uuid.uuid4())
    assert result.code == 404