-
Notifications
You must be signed in to change notification settings - Fork 83
128 lines (118 loc) · 3.98 KB
/
test_query.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: test_query
on:
push:
workflow_call:
jobs:
determine_tests:
uses: ./github/workflows/which-tests-to-run.yaml
# ==== Query Service Jobs ====
build-container-query-service:
name: Build Legacy (Query Service) test container
timeout-minutes: 30
runs-on: [self-hosted, builder]
needs: determine_tests
if: ${{ needs.determine_tests.outputs.should_run_query_tests == 'true' }}
# runs-on: ubuntu-latest
env:
REGISTRY: us-east4-docker.pkg.dev/weave-support-367421/weave-images
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
registry: us-east4-docker.pkg.dev
username: _json_key
password: ${{ secrets.gcp_sa_key }}
# this script is hardcoded to build for linux/amd64
- name: Prune docker cache
run: docker system prune -f
- name: Build legacy (query sevice) unit test image
run: python3 weave/docker/docker_build.py build_deps weave-test-python-query-service builder . weave_query/Dockerfile.ci.test
test-query-service:
name: Legacy (Query Service) Python unit tests
timeout-minutes: 15 # do not raise! running longer than this indicates an issue with the tests. fix there.
needs:
- build-container-query-service
# runs-on: [self-hosted, gke-runner]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
job_num: [0, 1]
# runs-on: ubuntu-latest
container: us-east4-docker.pkg.dev/weave-support-367421/weave-images/weave-test-python-query-service:${{ github.sha }}
services:
wandbservice:
image: us-central1-docker.pkg.dev/wandb-production/images/local-testcontainer:master
credentials:
username: _json_key
password: ${{ secrets.gcp_wb_sa_key }}
env:
CI: 1
WANDB_ENABLE_TEST_CONTAINER: true
ports:
- '8080:8080'
- '8083:8083'
- '9015:9015'
options: --health-cmd "curl --fail http://localhost:8080/healthz || exit 1" --health-interval=5s --health-timeout=3s
steps:
# - uses: datadog/agent-github-action@v1.3
# with:
# api_key: ${{ secrets.DD_API_KEY }}
- uses: actions/checkout@v2
- name: Verify wandb server is running
run: curl -s http://wandbservice:8080/healthz
- name: Run Legacy (Query Service) Python Unit Tests
env:
DD_SERVICE: weave-python
DD_ENV: ci
WEAVE_SENTRY_ENV: ci
CI: 1
WB_SERVER_HOST: http://wandbservice
WEAVE_SERVER_DISABLE_ECOSYSTEM: 1
run: |
source /root/venv/bin/activate && \
cd weave_query && \
pytest \
--job-num=${{ matrix.job_num }} \
--timeout=90 \
--ddtrace \
--durations=5 \
.
test-query-service-matrix-check: # This job does nothing and is only used for the branch protection
needs:
- test-query-service
- determine_tests
if: ${{ needs.determine_tests.outputs.should_run_query_tests == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Passes if all test-query-service jobs succeeded
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
# ==== Weave UI Jobs ====
weavejs-lint-compile:
name: WeaveJS Lint and Compile
runs-on: ubuntu-latest
needs: determine_tests
if: ${{ needs.determine_tests.outputs.should_run_query_tests == 'true' }}
# runs-on: [self-hosted, gke-runner]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v1
with:
node-version: '18.x'
- run: |
set -e
cd weave-js
yarn install --frozen-lockfile
yarn generate
yarn eslint --max-warnings=0
yarn tslint
yarn prettier
yarn run tsc