Skip to content

Commit

Permalink
Merge branch 'master' into submissionXmlToFieldStream-fix-end
Browse files Browse the repository at this point in the history
  • Loading branch information
alxndrsn committed Dec 10, 2024
2 parents c4a0a2b + 7bb0360 commit b136688
Show file tree
Hide file tree
Showing 92 changed files with 3,176 additions and 1,027 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2.1
jobs:
build:
docker:
- image: cimg/node:20.17.0
- image: cimg/node:22.12.0
- image: cimg/postgres:14.10
environment:
POSTGRES_PASSWORD: odktest
Expand All @@ -18,7 +18,7 @@ jobs:
find . -size +1000000c -not -path './.git/*' | grep .
[[ $? -eq 1 ]]
- run: make check-file-headers
- run: npm ci --legacy-peer-deps
- run: npm ci
- run: node lib/bin/create-docker-databases.js
- run: make test-ci
- store_test_results:
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/oidc-e2e.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: OIDC e2e tests

on: push
on:
push:
pull_request:

env:
DEBUG: pw:api
Expand All @@ -27,10 +29,10 @@ jobs:
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
- name: Set node version
uses: actions/setup-node@v4
with:
node-version: 20.17.0
node-version: 22.12.0
cache: 'npm'
- run: make test-oidc-e2e
- name: Archive playwright screenshots
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/oidc-integration.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: OIDC integration tests

on: push
on:
push:
pull_request:

jobs:
oidc-integration-test:
Expand All @@ -23,12 +25,12 @@ jobs:
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
- name: Set node version
uses: actions/setup-node@v4
with:
node-version: 20.17.0
node-version: 22.12.0
cache: 'npm'
- run: npm ci --legacy-peer-deps
- run: npm ci
- run: FAKE_OIDC_ROOT_URL=http://localhost:9898 make fake-oidc-server-ci > fake-oidc-server.log &
- run: node lib/bin/create-docker-databases.js
- run: make test-oidc-integration
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/s3-e2e.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: S3 E2E Tests

on: push
on:
push:
pull_request:

jobs:
s3-e2e:
Expand Down Expand Up @@ -41,12 +43,12 @@ jobs:
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
- name: Set node version
uses: actions/setup-node@v4
with:
node-version: 20.17.0
node-version: 22.12.0
cache: 'npm'
- run: npm ci --legacy-peer-deps
- run: npm ci
- run: node lib/bin/create-docker-databases.js
- name: E2E Test
timeout-minutes: 10
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/soak-test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Soak Test

on: push
on:
push:
branches: master

jobs:
soak-test:
Expand All @@ -23,12 +25,12 @@ jobs:
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
- name: Set node version
uses: actions/setup-node@v4
with:
node-version: 20.17.0
node-version: 22.12.0
cache: 'npm'
- run: npm ci --legacy-peer-deps
- run: npm ci
- run: node lib/bin/create-docker-databases.js
- name: Soak Test
timeout-minutes: 10
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/standard-e2e.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Standard E2E Tests

on: push
on:
push:
pull_request:

env:
LOG_LEVEL: DEBUG
Expand All @@ -26,12 +28,12 @@ jobs:
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
- name: Set node version
uses: actions/setup-node@v4
with:
node-version: 20.10.0
node-version: 22.12.0
cache: 'npm'
- run: npm ci --legacy-peer-deps
- run: npm ci
- run: node lib/bin/create-docker-databases.js
- name: E2E Test
timeout-minutes: 10
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/standard-suite.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Full Standard Test Suite

on: push
on:
push:
pull_request:

jobs:
standard-tests:
Expand All @@ -23,11 +25,11 @@ jobs:
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
- name: Set node version
uses: actions/setup-node@v4
with:
node-version: 20.17.0
node-version: 22.12.0
cache: 'npm'
- run: npm ci --legacy-peer-deps
- run: npm ci
- run: node lib/bin/create-docker-databases.js
- run: make test
48 changes: 38 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
default: base

node_modules: package.json
npm install --legacy-peer-deps
npm install
touch node_modules

.PHONY: node_version
node_version: node_modules
node lib/bin/enforce-node-version.js


################################################################################
# OIDC

.PHONY: test-oidc-integration
test-oidc-integration: node_version
TEST_AUTH=oidc NODE_CONFIG_ENV=oidc-integration-test make test-integration
Expand All @@ -26,6 +34,10 @@ fake-oidc-server-ci:
cd test/e2e/oidc/fake-oidc-server && \
node index.mjs


################################################################################
# S3

.PHONY: fake-s3-accounts
fake-s3-accounts: node_version
NODE_CONFIG_ENV=s3-dev node lib/bin/s3-create-bucket.js
Expand All @@ -52,9 +64,9 @@ fake-s3-server-ephemeral:
fake-s3-server-persistent:
docker run --detach $(S3_SERVER_ARGS)

.PHONY: node_version
node_version: node_modules
node lib/bin/enforce-node-version.js

################################################################################
# DATABASE MIGRATIONS

.PHONY: migrations
migrations: node_version
Expand All @@ -64,8 +76,12 @@ migrations: node_version
check-migrations: node_version
node lib/bin/check-migrations.js


################################################################################
# RUN SERVER

.PHONY: base
base: node_version migrations check-migrations
base: node_modules node_version migrations check-migrations

.PHONY: dev
dev: base
Expand All @@ -79,34 +95,42 @@ run: base
debug: base
node --debug --inspect lib/bin/run-server.js


################################################################################
# TEST & LINT

.PHONY: test
test: lint
BCRYPT=insecure npx mocha --recursive
BCRYPT=insecure npx --node-options="--no-deprecation" mocha --recursive

.PHONY: test-ci
test-ci: lint
BCRYPT=insecure npx mocha --recursive --reporter test/ci-mocha-reporter.js
BCRYPT=insecure npx --node-options="--no-deprecation" mocha --recursive --reporter test/ci-mocha-reporter.js

.PHONY: test-fast
test-fast: node_version
BCRYPT=insecure npx mocha --recursive --fgrep @slow --invert
BCRYPT=insecure npx --node-options="--no-deprecation" mocha --recursive --fgrep @slow --invert

.PHONY: test-integration
test-integration: node_version
BCRYPT=insecure npx mocha --recursive test/integration
BCRYPT=insecure npx --node-options="--no-deprecation" mocha --recursive test/integration

.PHONY: test-unit
test-unit: node_version
BCRYPT=insecure npx mocha --recursive test/unit

.PHONY: test-coverage
test-coverage: node_version
npx nyc -x "**/migrations/**" --reporter=lcov node_modules/.bin/_mocha --recursive test
npx --node-options="--no-deprecation" nyc -x "**/migrations/**" --reporter=lcov node_modules/.bin/_mocha --recursive test

.PHONY: lint
lint: node_version
npx eslint --cache --max-warnings 0 .


################################################################################
# POSTGRES

.PHONY: run-docker-postgres
run-docker-postgres: stop-docker-postgres
docker start odk-postgres14 || (\
Expand All @@ -123,6 +147,10 @@ stop-docker-postgres:
rm-docker-postgres: stop-docker-postgres
docker rm odk-postgres14 || true


################################################################################
# OTHER

.PHONY: check-file-headers
check-file-headers:
git ls-files | node lib/bin/check-file-headers.js
Expand Down
Loading

0 comments on commit b136688

Please sign in to comment.