ci(feature flags): test workspaces (#2559)

* ci(feature flags): test workspaces

* It was an overwrite not a merge ;(

* adjustments

* ignoring FF related tests, if FFs are off

---------

Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
This commit is contained in:
Iain Sproat 2024-08-02 08:31:50 +01:00 коммит произвёл GitHub
Родитель 5096ba20d6
Коммит b8cc6928cd
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
2 изменённых файлов: 51 добавлений и 3 удалений

Просмотреть файл

@ -22,6 +22,9 @@ workflows:
# run tests for any commit on any branch, including any tags
only: /.*/
- test-server-no-ff:
filters: *filters-allow-all
- test-frontend-2:
filters: *filters-allow-all
@ -64,6 +67,7 @@ workflows:
# - test-viewer
# - test-objectsender
# - test-server
# - test-server-no-ff
# - docker-build-server
# - docker-build-frontend
# - docker-build-frontend-2
@ -87,6 +91,7 @@ workflows:
- test-viewer
- test-objectsender
- test-server
- test-server-no-ff
- docker-build-server
- docker-build-frontend
- docker-build-frontend-2
@ -180,6 +185,7 @@ workflows:
- test-viewer
- test-objectsender
- test-server
- test-server-no-ff
- docker-publish-frontend:
context: *docker-hub-context
@ -193,6 +199,7 @@ workflows:
- test-viewer
- test-objectsender
- test-server
- test-server-no-ff
- docker-publish-frontend-2:
context: *docker-hub-context
@ -206,6 +213,7 @@ workflows:
- test-viewer
- test-objectsender
- test-server
- test-server-no-ff
- docker-publish-webhooks:
context: *docker-hub-context
@ -219,6 +227,7 @@ workflows:
- test-viewer
- test-objectsender
- test-server
- test-server-no-ff
- docker-publish-file-imports:
context: *docker-hub-context
@ -232,6 +241,7 @@ workflows:
- test-viewer
- test-objectsender
- test-server
- test-server-no-ff
- docker-publish-previews:
context: *docker-hub-context
@ -245,6 +255,7 @@ workflows:
- test-viewer
- test-objectsender
- test-server
- test-server-no-ff
- docker-publish-test-container:
context: *docker-hub-context
@ -258,6 +269,7 @@ workflows:
- test-viewer
- test-objectsender
- test-server
- test-server-no-ff
- docker-publish-monitor-container:
context: *docker-hub-context
@ -271,6 +283,7 @@ workflows:
- test-viewer
- test-objectsender
- test-server
- test-server-no-ff
- docker-publish-docker-compose-ingress:
context: *docker-hub-context
@ -284,6 +297,7 @@ workflows:
- test-viewer
- test-objectsender
- test-server
- test-server-no-ff
- publish-helm-chart:
filters: &filters-publish
@ -322,6 +336,7 @@ workflows:
requires:
- get-version
- test-server
- test-server-no-ff
- test-ui-components
- test-frontend-2
- test-viewer
@ -419,7 +434,7 @@ jobs:
name: git diff
when: on_fail
test-server:
test-server: &test-server-job
docker:
- image: cimg/node:18.19.0
- image: cimg/redis:7.2.4
@ -448,7 +463,6 @@ jobs:
S3_CREATE_BUCKET: 'true'
REDIS_URL: 'redis://127.0.0.1:6379'
S3_REGION: '' # optional, defaults to 'us-east-1'
FF_AUTOMATE_MODULE_ENABLED: 'true'
AUTOMATE_ENCRYPTION_KEYS_PATH: 'test/assets/automate/encryptionKeys.json'
steps:
- checkout
@ -517,6 +531,28 @@ jobs:
# path: packages/server/coverage/lcov-report
# destination: package/server/coverage
test-server-no-ff:
<<: *test-server-job
environment:
NODE_ENV: test
DATABASE_URL: 'postgres://speckle:speckle@127.0.0.1:5432/speckle2_test'
PGDATABASE: speckle2_test
PGUSER: speckle
SESSION_SECRET: 'keyboard cat'
STRATEGY_LOCAL: 'true'
CANONICAL_URL: 'http://127.0.0.1:3000'
S3_ENDPOINT: 'http://127.0.0.1:9000'
S3_ACCESS_KEY: 'minioadmin'
S3_SECRET_KEY: 'minioadmin'
S3_BUCKET: 'speckle-server'
S3_CREATE_BUCKET: 'true'
REDIS_URL: 'redis://127.0.0.1:6379'
S3_REGION: '' # optional, defaults to 'us-east-1'
AUTOMATE_ENCRYPTION_KEYS_PATH: 'test/assets/automate/encryptionKeys.json'
FF_AUTOMATE_MODULE_ENABLED: 'false' # Disable all FFs
FF_WORKSPACES_MODULE_ENABLED: 'false'
FF_GENDOAI_MODULE_ENABLED: 'false'
test-frontend-2:
docker: &docker-node-browsers-image
- image: cimg/node:18.19.0-browsers

Просмотреть файл

@ -1,9 +1,21 @@
'use strict'
// Need to init env vars for accurate FF reading
const dotenv = require('dotenv')
dotenv.config({ path: `./.env.test` })
dotenv.config({ path: `./.env` })
// Resolve FF values for ignore patterns
const Environment = require('@speckle/shared/dist/commonjs/environment/index.js')
const featureFlags = Environment.getFeatureFlags()
const ignore = [
...(!featureFlags.FF_AUTOMATE_MODULE_ENABLED ? ['modules/automate/**/*'] : []),
...(!featureFlags.FF_WORKSPACES_MODULE_ENABLED ? ['modules/workspaces/**/*'] : [])
]
/** @type {import("mocha").MochaOptions} */
const config = {
spec: ['modules/**/*.spec.js', 'modules/**/*.spec.ts', 'logging/**/*.spec.js'],
require: ['ts-node/register', 'test/hooks.js'],
...(ignore.length ? { ignore } : {}),
slow: 0,
timeout: '150000',
exit: true