Skip to content

Commit

Permalink
Fix job test and remove job pytest.
Browse files Browse the repository at this point in the history
  • Loading branch information
CPWstatic committed Sep 2, 2021
1 parent 84b69a5 commit da8446c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 99 deletions.
6 changes: 3 additions & 3 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@ sess: currdir
python3 -m pytest -m "not skip" -k "not tck" job/test_session.py

jobs: currdir
python3 -m pytest -m "not skip" -k "not tck" job/test_jobs.py
python3 -m pytest -m "not skip" tck/steps/test_jobs.py

test: sess jobs
test: sess
python3 -m pytest -n$(J) --dist=loadfile -m "not skip" -k "not tck" $(TEST_DIR)

slow-query: currdir
python3 -m pytest -n$(J) -m "not skip" tck/steps/test_kill_slow_query_via_same_service.py && \
python3 -m pytest -n$(J) -m "not skip" tck/steps/test_kill_slow_query_via_different_service.py

tck: slow-query
tck: jobs slow-query
python3 -m pytest -n$(J) -m "not skip" tck/steps/test_tck.py

fail: currdir
Expand Down
89 changes: 0 additions & 89 deletions tests/job/test_jobs.py

This file was deleted.

15 changes: 8 additions & 7 deletions tests/tck/features/job/Job.feature → tests/tck/job/Job.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
@job
# Copyright (c) 2021 vesoft inc. All rights reserved.
#
# This source code is licensed under Apache 2.0 License,
# attached with Common Clause Condition 1.0, found in the LICENSES directory.
Feature: Submit job space requirements

Scenario: submit job require space
Expand Down Expand Up @@ -85,16 +88,14 @@ Feature: Submit job space requirements
SHOW JOB {};
"""
Then the result should be, in order:
| Job Id(TaskId) | Command(Dest) | Status | Start Time | Stop Time |
| /\d+/ | "STATS" | /\^"FINISHED"/ | /\w+/ | /\w+/ |
| /\d+/ | /\w+/ | /\w+/ | /\w+/ | /\w+/ |
| Job Id(TaskId) | Command(Dest) | Status | Start Time | Stop Time |
| /\d+/ | "STATS" | "FINISHED" | /\w+/ | /\w+/ |
| /\d+/ | /\w+/ | "FINISHED" | /\w+/ | /\w+/ |
When executing query, fill replace holders with element index of 0 in job_id:
"""
STOP JOB {};
"""
Then the result should be, in order:
| Result |
| "Job stopped" |
Then an ExecutionError should be raised at runtime: Save job failure!

# This is skipped becuase it is hard to simulate the situation
# When executing query:
Expand Down
9 changes: 9 additions & 0 deletions tests/tck/steps/test_jobs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2020 vesoft inc. All rights reserved.
#
# This source code is licensed under Apache 2.0 License,
# attached with Common Clause Condition 1.0, found in the LICENSES directory.

from pytest_bdd import scenarios


scenarios('job/Job.feature')

0 comments on commit da8446c

Please sign in to comment.