-
Notifications
You must be signed in to change notification settings - Fork 2
/
test-tasks.yaml
78 lines (71 loc) · 1.87 KB
/
test-tasks.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
version: "3"
vars:
G_UNIT_TEST_BINARY: "{{.G_BUILD_SPIDER_DIR}}/tests/unitTest"
G_TEST_VENV_DIR: "{{.G_BUILD_DIR}}/test-venv"
G_TEST_VENV_CHECKSUM_FILE: "{{.G_BUILD_DIR}}/test#venv.md5"
tasks:
non-storage-unit-tests:
deps:
- "build-unit-test"
cmds:
- "{{.G_UNIT_TEST_BINARY}} \"~[storage]\""
storage-unit-tests:
deps:
- "build-unit-test"
cmds:
- "{{.G_UNIT_TEST_BINARY}} \"[storage]\""
all:
deps:
- "build-unit-test"
cmds:
- "{{.G_UNIT_TEST_BINARY}}"
build-unit-test:
internal: true
deps:
- task: ":build:target"
vars:
TARGETS: ["spider_task_executor", "unitTest", "worker_test"]
integration:
dir: "{{.G_BUILD_SPIDER_DIR}}"
deps:
- "venv"
- task: ":build:target"
vars:
TARGETS: [
"spider_task_executor",
"worker_test",
"client_test",
"spider_worker",
"spider_scheduler",
"integrationTest"]
cmd: |-
. ../test-venv/bin/activate
../test-venv/bin/pytest tests/integration
venv:
internal: true
vars:
CHECKSUM_FILE: "{{.G_TEST_VENV_CHECKSUM_FILE}}"
OUTPUT_DIR: "{{.G_TEST_VENV_DIR}}"
sources:
- "{{.ROOT_DIR}}/taskfile.yaml"
- "{{.TASKFILE}}"
- "test-requirements.txt"
generates: ["{{.CHECKSUM_FILE}}"]
run: "once"
deps:
- ":init"
- task: ":utils:validate-checksum"
vars:
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}"
DATA_DIR: "{{.OUTPUT_DIR}}"
cmds:
- task: ":utils:create-venv"
vars:
LABEL: "test"
OUTPUT_DIR: "{{.OUTPUT_DIR}}"
REQUIREMENTS_FILE: "test-requirements.txt"
# This command must be last
- task: ":utils:compute-checksum"
vars:
DATA_DIR: "{{.OUTPUT_DIR}}"
OUTPUT_FILE: "{{.CHECKSUM_FILE}}"