-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
35 lines (34 loc) · 1 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
35 lines (34 loc) · 1 KB
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
stages:
- test
integration-test:
stage: test
image: python:3.12-slim
services:
- name: protoforge:latest
alias: protoforge
before_script:
- pip install protoforge
- |
for i in $(seq 1 30); do
if curl -sf http://protoforge:8000/health; then
echo "ProtoForge is ready"
break
fi
echo "Waiting... ($i/30)"
sleep 2
done
script:
- |
python -c "
from protoforge.sdk import ProtoForgeClient
client = ProtoForgeClient('http://protoforge:8000')
client.start_protocol('modbus_tcp', {'host': '0.0.0.0', 'port': 5020})
config = client.instantiate_template('modbus_temperature_sensor', 'ci-test-001', 'CI Test')
device = client.create_device(**config)
assert device['id'] == 'ci-test-001'
points = client.read_points('ci-test-001')
assert len(points) > 0
client.delete_device('ci-test-001')
client.stop_protocol('modbus_tcp')
print('CI integration test passed!')
"