opencti
opencti copied to clipboard
CI improvement: when opencti does not start on drone, the step is green, should be red
Description
Environment
- OS (where OpenCTI server runs): { e.g. Mac OS 10, Windows 10, Ubuntu 16.4, etc. }
- OpenCTI version: { e.g. OpenCTI 1.0.2 }
- OpenCTI client: { e.g. frontend or python }
- Other environment details:
Reproducible Steps
Steps to create the smallest reproducible scenario:
- Make the "opencti-raw-start" fail
- Watch CI execution
Issues are that:
- it's hard to understand this kind of failure
- the longest part (api test & end to end test) are run but the CI will be red at the end anyway, better to fail fast and save drone resources.
Expected Output
Step is red, and test should not be run (to save about 20 minutes of run it's going to fail anyway)
Actual Output
There is a fatal error in the console but "opencti-raw-start" is green.
Additional information
- check if an heakthcheck exists for drone services, if not implement a light one.
Screenshots (optional)
Some notes:
- Drone service cannot be red as per Drone documentation. Instead the advice is to add a healthcheck with curl before running tests.
Tested today in test-api step, for some reason this kind of curl command are not working (service is timing out 🤯 )
- curl --max-time 30 --retry-delay 30 --retry 4 "http://opencti-direct-start:4300/health?health_access_key=testHealth"
- curl --max-time 30 --retry-delay 30 --retry 4 "http://opencti-raw-start:4100/health?health_access_key=testHealth"
- curl --max-time 30 "http://opencti-live-start:4200/health?health_access_key=testHealth"
- curl --max-time 30 -fsS -o /dev/null "http://opencti-restore-start:4400/health?health_access_key=testHealth"