-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Rachel Chen
authored and
Rachel Chen
committed
Sep 20, 2024
1 parent
f030a4d
commit c0270df
Showing
8 changed files
with
87 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,6 +60,7 @@ | |
(7, "dlq"), | ||
(8, "optimize"), | ||
(9, "admin_auth"), | ||
(10, "job"), | ||
] | ||
} | ||
VALIDATE_DATASET_YAMLS_ON_STARTUP = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import pytest | ||
|
||
from snuba.manual_jobs import FINISHED, NOT_STARTED, JobSpec, get_job_status | ||
from snuba.manual_jobs.toy_job import ToyJob | ||
|
||
JOB_ID = "abc1234" | ||
test_job_spec = JobSpec(job_id=JOB_ID, job_type="ToyJob") | ||
|
||
# @pytest.fixture(autouse=True) | ||
# def setup_test_job() -> Job: | ||
# return ToyJob(test_job_spec, dry_run=True) | ||
|
||
|
||
@pytest.mark.redis_db | ||
def test_job_status_changes_to_finished() -> None: | ||
# test_job = setup_test_job | ||
test_job = ToyJob(test_job_spec, dry_run=True) | ||
assert get_job_status(JOB_ID) == NOT_STARTED | ||
test_job.execute() | ||
assert get_job_status(JOB_ID) == FINISHED | ||
|
||
|
||
@pytest.mark.redis_db | ||
def test_job_status_with_invalid_job_id() -> None: | ||
assert get_job_status(JOB_ID) == NOT_STARTED | ||
with pytest.raises(KeyError): | ||
get_job_status("invalid_job_id") |