-
Notifications
You must be signed in to change notification settings - Fork 4
131 lines (104 loc) · 4.04 KB
/
run-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
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
129
130
131
name: (With Mongo) Unit, integration, and notebook tests
on:
push:
schedule:
- cron: '0 12 * * *' # Runs every day at 12 PM UTC (7 AM EST)
jobs:
build:
runs-on: ubuntu-latest
env:
MONGO_ENABLED: true
LMDB_ENABLED: false
timeout-minutes: 60
if: "!contains(github.event.head_commit.message, 'CI Bot')"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
- name: Show OS Info
run: '[[ "$OSTYPE" == "linux-gnu"* ]] && { echo "OS Type: Linux"; (command -v lsb_release &> /dev/null && lsb_release -a) || cat /etc/os-release; uname -r; } || [[ "$OSTYPE" == "darwin"* ]] && { echo "OS Type: macOS"; sw_vers; uname -r; } || echo "Unsupported OS type: $OSTYPE"'
- name: Start docker compose with redis
run: make services-mongo
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install basic deps
run: pip install .[mongo]
- name: Check dbs utilization
run: python -c "from flowcept.configs import MONGO_ENABLED, LMDB_ENABLED; print('MONGO?', MONGO_ENABLED); print('LMDB?', LMDB_ENABLED)"
- name: Run simple test
run: |
python examples/simple_instrumented_script.py | tee output.log
cat output.log
grep -q "ERROR" output.log && exit 1
rm output.log
- name: Install Dask dependencies alone and run a simple Dask test
run: |
pip uninstall flowcept -y
pip install .[dask]
python examples/dask_example.py | tee output.log
cat output.log
grep -q "ERROR" output.log && exit 1
rm output.log
- name: Install MLFlow dependencies alone and run a simple MLFlow test
run: |
pip uninstall flowcept -y
pip install .[mlflow]
python examples/mlflow_example.py | tee output.log
cat output.log
grep -q "ERROR" output.log && exit 1
rm output.log
- name: Install Tensorboard dependencies alone and run a simple Tensorboard test
run: |
pip uninstall flowcept -y
pip install .[tensorboard]
python examples/tensorboard_example.py | tee output.log
cat output.log
grep -q "ERROR" output.log && exit 1
rm output.log
- name: Install all dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[all]
python -m pip install .[ml_dev]
- name: List installed packages
run: pip list
- name: Test with pytest and redis
run: |
make tests
- name: Test notebooks with pytest and redis
run: make tests-notebooks
- name: Shut down docker compose
run: make services-stop-mongo
- name: Clean up
run: |
make clean
find /home/runner/runners/ -type f -name "*.log" -exec sh -c 'echo {}; >"{}"' \;
- name: Start docker compose with kafka
run: docker compose -f deployment/compose-kafka.yml up -d
- name: Wait for one minute
run: sleep 60
- name: Check liveness
run: |
export MQ_TYPE=kafka
export MQ_PORT=9092
python -c 'from flowcept.configs import MQ_TYPE, MQ_PORT; print(f"MQ_TYPE={MQ_TYPE}"); print(f"MQ_PORT={MQ_PORT}")'
python -c 'from flowcept import Flowcept; assert Flowcept.services_alive()'
- name: Run tests with kafka
run: |
export MQ_TYPE=kafka
export MQ_PORT=9092
make tests
- name: Stop docker compose with kafka
run: docker compose -f deployment/compose-kafka.yml down
- name: Clean up
run: |
make clean
find /home/runner/runners/ -type f -name "*.log" -exec sh -c 'echo {}; >"{}"' \; || true
docker image prune -a -f
- name: List large files
run: find . -type f -exec du -h {} + | sort -h