opencti icon indicating copy to clipboard operation
opencti copied to clipboard

CI improvement: when opencti does not start on drone, the step is green, should be red

Open aHenryJard opened this issue 1 year ago • 1 comments

Description

Environment

  1. OS (where OpenCTI server runs): { e.g. Mac OS 10, Windows 10, Ubuntu 16.4, etc. }
  2. OpenCTI version: { e.g. OpenCTI 1.0.2 }
  3. OpenCTI client: { e.g. frontend or python }
  4. Other environment details:

Reproducible Steps

Steps to create the smallest reproducible scenario:

  1. Make the "opencti-raw-start" fail
  2. 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. image (1)

Additional information

  • check if an heakthcheck exists for drone services, if not implement a light one.

Screenshots (optional)

aHenryJard avatar Jun 06 '24 05:06 aHenryJard

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"

aHenryJard avatar Jun 20 '24 13:06 aHenryJard