|
| 1 | +# Integration Tests |
| 2 | + |
| 3 | +## Running |
| 4 | + |
| 5 | +```bash |
| 6 | +# Start Cortex |
| 7 | +docker run -d --name cortex-test -p 9009:9009 \ |
| 8 | + -v $(pwd)/integration/cortex-config.yaml:/etc/cortex/config.yaml \ |
| 9 | + cortexproject/cortex:v1.18.1 \ |
| 10 | + -config.file=/etc/cortex/config.yaml \ |
| 11 | + -target=all,alertmanager |
| 12 | + |
| 13 | +# Wait for ready |
| 14 | +until curl -s http://localhost:9009/ready > /dev/null 2>&1; do sleep 2; done && echo "Ready" |
| 15 | + |
| 16 | +# Run tests |
| 17 | +go test -mod=vendor -tags=integration -v -count=1 ./integration/... |
| 18 | + |
| 19 | +# Cleanup |
| 20 | +docker stop cortex-test && docker rm cortex-test |
| 21 | +``` |
| 22 | + |
| 23 | +## Coverage |
| 24 | + |
| 25 | +These integration tests require a running Cortex instance. Offline commands (lint, check, prepare, parse) are covered by unit tests in `pkg/rules/`. |
| 26 | + |
| 27 | +| Command | Tested? | |
| 28 | +|---------|:---:| |
| 29 | +| **rules load/list/print/get** | Yes | |
| 30 | +| **rules delete (group)** | Yes | |
| 31 | +| **rules delete-namespace** | Yes | |
| 32 | +| **alertmanager load** | Yes | |
| 33 | +| **alertmanager load (with templates)** | Yes | |
| 34 | +| **alertmanager get** | Yes | |
| 35 | +| **alertmanager delete** | Yes | |
| 36 | +| **remote-read dump/stats** | Yes | |
| 37 | +| **remote-read export** | Yes | |
| 38 | +| **loadgen (write workload)** | Yes | |
| 39 | +| **analyse** (grafana/ruler/dashboard/rule-file) | No | |
| 40 | +| **bucket-validation** | No | |
| 41 | +| **config** (use-context) | No | |
| 42 | +| **alert verify** | No | |
| 43 | +| **push-gateway** | No | |
0 commit comments