Skip to content

Commit

Permalink
[integration] Parallelize testing
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelHassine committed Mar 10, 2024
1 parent 14506d5 commit d793a45
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 7 deletions.
61 changes: 57 additions & 4 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ steps:
- name: api-coverage
image: plugins/codecov
settings:
token: e5c6fb05-76f7-4985-86cf-ff843d5d103e
token:
from_secret: codecov_token
paths:
- opencti-platform/opencti-graphql/coverage
depends_on:
- api-tests

- name: frontend-tests
image: node:20-alpine
Expand All @@ -80,12 +83,12 @@ steps:
- name: frontend-e2e-tests
image: node:20.11.1
volumes:
- name: cache-node-frontend
- name: cache-node-frontend-e2e
path: /drone/src/opencti-platform/opencti-front/node_modules
- name: cache-python
path: /usr/lib/python3.11
environment:
BACK_END_URL: http://opencti-raw-start:4100
BACK_END_URL: http://opencti-e2e-start:4500
E2E_TEST: true
commands:
- apt-get update
Expand All @@ -95,6 +98,8 @@ steps:
- npx playwright install --with-deps chromium
- yarn build
- yarn test:e2e
depends_on:
- frontend-tests

- name: build-circleci
image: curlimages/curl
Expand All @@ -110,6 +115,10 @@ steps:
exclude:
- pull_request
- tag
depends_on:
- api-tests
- frontend-tests
- frontend-e2e-tests

- name: build-circleci-release
image: curlimages/curl
Expand All @@ -121,6 +130,10 @@ steps:
when:
event:
- tag
depends_on:
- api-tests
- frontend-tests
- frontend-e2e-tests

- name: slack
image: plugins/slack
Expand All @@ -131,6 +144,10 @@ steps:
channel: notifications
when:
status: [success, failure]
depends_on:
- api-tests
- frontend-tests
- frontend-e2e-tests

services:
- name: redis
Expand Down Expand Up @@ -261,7 +278,7 @@ services:
- name: opencti-restore-start
image: nikolaik/python-nodejs:python3.11-nodejs20-alpine
volumes:
- name: cache-node-raw-start-backend
- name: cache-node-restore-start-backend
path: /tmp/restore-start-platform/node_modules
- name: cache-python
path: /usr/lib/python3.11
Expand All @@ -288,6 +305,36 @@ services:
- CLIENT_PYTHON_BRANCH=$([[ "$(echo "$(git ls-remote --heads https://github.com/OpenCTI-Platform/client-python.git opencti/$BRANCH)")" != '' ]] && echo opencti/$BRANCH || echo 'master')
- pip3 install --upgrade --force git+https://github.com/OpenCTI-Platform/client-python@$CLIENT_PYTHON_BRANCH
- NODE_OPTIONS=--max_old_space_size=8192 yarn start
- name: opencti-e2e-start
image: nikolaik/python-nodejs:python3.11-nodejs20-alpine
volumes:
- name: cache-node-e2e-start-backend
path: /tmp/e2e-start-platform/node_modules
- name: cache-python
path: /usr/lib/python3.11
environment:
APP__PORT: 4500
APP__ADMIN__PASSWORD: admin
APP__ADMIN__TOKEN: bfa014e0-e02e-4aa6-a42b-603b19dcf159
REDIS__HOSTNAME: redis
REDIS__NAMESPACE: e2e-start
ELASTICSEARCH__URL: http://elastic:9200
ELASTICSEARCH__INDEX_PREFIX: e2e-start
MINIO__ENDPOINT: minio
MINIO__BUCKET_NAME: e2e-start-bucket
RABBITMQ__HOSTNAME: rabbitmq
EXPIRATION_SCHEDULER__ENABLED: false
SUBSCRIPTION_SCHEDULER__ENABLED: false
commands:
- cp -a opencti-platform/* /tmp/e2e-start-platform/
- apk add build-base git libffi-dev cargo
- cd /tmp/e2e-start-platform/opencti-graphql
- yarn install
- yarn install:python
- BRANCH=$(echo $DRONE_COMMIT_BRANCH | cut -d "/" -f 2)
- CLIENT_PYTHON_BRANCH=$([[ "$(echo "$(git ls-remote --heads https://github.com/OpenCTI-Platform/client-python.git opencti/$BRANCH)")" != '' ]] && echo opencti/$BRANCH || echo 'master')
- pip3 install --upgrade --force git+https://github.com/OpenCTI-Platform/client-python@$CLIENT_PYTHON_BRANCH
- NODE_OPTIONS=--max_old_space_size=8192 yarn start

volumes:
- name: cache-node-backend
Expand All @@ -305,9 +352,15 @@ volumes:
- name: cache-node-restore-start-backend
host:
path: /tmp/cache-node-restore-start-backend
- name: cache-node-e2e-start-backend
host:
path: /tmp/cache-node-e2e-start-backend
- name: cache-node-frontend
host:
path: /tmp/cache-node-frontend
- name: cache-node-frontend-e2e
host:
path: /tmp/cache-node-frontend-e2e
- name: cache-python
host:
path: /tmp/cache-python
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ const TopBarComponent: FunctionComponent<TopBarProps> = ({
</Grid>
<Grid item={true} xs={6}>
<Tooltip title={isNotEmptyField(openBASUrl) ? t_i18n('Platform connected') : t_i18n('Get OpenBAS now')}>
<a className={classes.xtmItem} href={isNotEmptyField(openBASUrl) ? openBASUrl : 'https://filigran.io'} target="_blank" rel="noreferrer">
<a className={classes.xtmItem} href={isNotEmptyField(openBASUrl) ? openBASUrl : 'https://filigran.io'} target="_blank" rel="noreferrer" onClick={handleCloseXtm}>
<Badge variant="dot" color={isNotEmptyField(openBASUrl) ? 'success' : 'warning'}>
<img style={{ width: 40 }} src={fileUri(theme.palette.mode === 'dark' ? obasDark : obasLight)} alt="OBAS" />
</Badge>
Expand All @@ -331,7 +331,7 @@ const TopBarComponent: FunctionComponent<TopBarProps> = ({
</Grid>
<Grid item={true} xs={6}>
<Tooltip title={t_i18n('Platform under construction, subscribe to update!')}>
<a className={classes.xtmItem} href="https://filigran.io" target="_blank" rel="noreferrer">
<a className={classes.xtmItem} href="https://filigran.io" target="_blank" rel="noreferrer" onClick={handleCloseXtm}>
<Badge variant="dot" color="info">
<img style={{ width: 40 }} src={fileUri(theme.palette.mode === 'dark' ? oermDark : oermLight)} alt="OERM" />
</Badge>
Expand All @@ -341,7 +341,7 @@ const TopBarComponent: FunctionComponent<TopBarProps> = ({
</Grid>
<Grid item={true} xs={6}>
<Tooltip title={t_i18n('Platform under construction, subscribe to update!')}>
<a className={classes.xtmItem} href="https://filigran.io" target="_blank" rel="noreferrer">
<a className={classes.xtmItem} href="https://filigran.io" target="_blank" rel="noreferrer" onClick={handleCloseXtm}>
<Badge variant="dot" color="info">
<img style={{ width: 40 }} src={fileUri(theme.palette.mode === 'dark' ? omtdDark : omtdLight)} alt="OMTD" />
</Badge>
Expand Down

0 comments on commit d793a45

Please sign in to comment.