This repository has been archived by the owner on Apr 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 63
87 lines (84 loc) · 2.75 KB
/
unit-tests.yml
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
79
80
81
82
83
84
85
86
87
name: Cook Scheduler, CLI, and JobClient unit tests
on:
pull_request:
branches:
- master
push:
branches:
- master
- 'build**'
- kubernetes_integration
schedule:
- cron: '0 0 * * *'
jobs:
test:
runs-on: ubuntu-20.04
env:
PYTEST_ADDOPTS: --color=yes
MESOS_NATIVE_JAVA_LIBRARY: /usr/lib/libmesos.so
CLJ_HTTP_ASYNC_POOL_TEST_DURATION_MULTIPLIER: 5
GDRIVE_LOG_POST_URL: https://script.google.com/macros/s/AKfycbxOB55OzrQSbpZO_0gzsxZaJ8LaUWWo3PDLNc-gCiMN1iObxu7x/exec
steps:
- uses: actions/checkout@v2
- name: Showcase docker state.
run: docker ps
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: '11'
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/project.clj') }}
restore-keys: ${{ runner.os }}-m2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.6.x'
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Setup tests
run: |
./cli/travis/setup.sh
cd scheduler && ./travis/setup.sh
- name: JobClient Java unit tests
run: cd ./jobclient/java && mvn test -X
- name: JobClient Python unit tests
run: cd ./jobclient/python && python -m pytest
- name: CLI unit tests
run: cd ./cli && python -m pytest
- name: Setup the database
run: cd ./scheduler/postgresql && bin/setup-database.sh
env:
PGPASSWORD: postgres
COOK_SCHEMA: cook_local
- name: Scheduler Unit tests
run: cd ./scheduler && lein with-profile +test test :all-but-benchmark
env:
PGPASSWORD: postgres
COOK_DB_TEST_PG_USER: cook_scheduler
COOK_DB_TEST_PG_SERVER: 127.0.0.1
COOK_DB_TEST_PG_SCHEMA: cook_local
services:
# Give it cook-postgres to match what our external build scripts use.
cook-postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432