Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/actions/cleanup-and-coverage/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: 'Cleanup and Coverage'
description: 'Stops CI services and uploads coverage reports to Codecov'

inputs:
profiles:
description: 'Docker Compose profiles to use (space-separated)'
required: false
default: ''
codecov-token:
description: 'Codecov token for uploading reports'
required: true
flags:
description: 'Flags to identify the coverage report'
required: false
default: '${{ github.job }}'

runs:
using: 'composite'
steps:
- name: Stop CI services
run: |
PROFILES=""
# Read from environment variable to avoid syntax issues
# related to gha templating
for profile in $INPUT_PROFILES; do
PROFILES="${PROFILES} --profile ${profile}"
done
docker compose ${PROFILES} down
shell: bash
env:
INPUT_PROFILES: ${{ inputs.profiles }}
working-directory: .github/docker

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ inputs.codecov-token }}
directory: /tmp/coverage/${{ github.job }}
flags: ${{ inputs.flags }}
if: ${{ !cancelled() }}
5 changes: 5 additions & 0 deletions .github/actions/setup-ci/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ runs:
run: |-
set -exu;
mkdir -p /tmp/artifacts/${JOB_NAME}/;
- name: Setup coverage directory
shell: bash
run: |-
set -exu;
mkdir -p /tmp/coverage/${JOB_NAME}/;
- uses: actions/setup-node@v4
with:
node-version: '22'
Expand Down
17 changes: 16 additions & 1 deletion .github/docker/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
services:
cloudserver:
image: ${CLOUDSERVER_IMAGE}
command: sh -c "yarn start > /artifacts/s3.log"
command: |
bash -c "
# Using tini to handle signals properly
tini -s -g -- npx nyc --clean --silent yarn start > /artifacts/s3.log &
PID=$$!
generate_coverage() {
echo 'Stopping NodeJS processes...'
kill -TERM $$PID 2>/dev/null || true
wait $$PID
echo 'Generating coverage report...'
npx nyc report --report-dir /coverage/test --reporter=lcov --reporter=text-summary
}
trap generate_coverage SIGTERM
wait $$PID
"
network_mode: "host"
volumes:
- /tmp/ssl:/ssl
- /tmp/ssl-kmip:/ssl-kmip
- ${HOME}/.aws/credentials:/root/.aws/credentials
- /tmp/artifacts/${JOB_NAME}:/artifacts
- /tmp/coverage/${JOB_NAME}:/coverage/test
environment:
- CI=true
- ENABLE_LOCAL_CACHE=true
Expand Down
53 changes: 52 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ jobs:
S3BACKEND: mem
S3_LOCATION_FILE: /usr/src/app/tests/locationConfig/locationConfigTests.json
S3DATA: multiple
S3METADATA: mongodb
JOB_NAME: ${{ github.job }}
steps:
- name: Checkout
Expand All @@ -242,7 +243,7 @@ jobs:
- name: Setup CI environment
uses: ./.github/actions/setup-ci
- name: Setup CI services
run: docker compose --profile sproxyd up -d
run: docker compose --profile sproxyd --profile mongo up -d
working-directory: .github/docker
- name: Run multiple backend test
run: |-
Expand All @@ -252,6 +253,14 @@ jobs:
yarn run multiple_backend_test | tee /tmp/artifacts/${{ github.job }}/tests.log
env:
S3_LOCATION_FILE: tests/locationConfig/locationConfigTests.json
- name: Cleanup and upload coverage
uses: ./.github/actions/cleanup-and-coverage
with:
profiles: >
sproxyd
mongo
codecov-token: ${{ secrets.CODECOV_TOKEN }}
if: always()
- name: Upload logs to artifacts
uses: scality/action-artifacts@v4
with:
Expand Down Expand Up @@ -290,6 +299,12 @@ jobs:
yarn run ft_test | tee /tmp/artifacts/${{ github.job }}/tests.log
env:
S3_LOCATION_FILE: tests/locationConfig/locationConfigTests.json
- name: Cleanup and upload coverage
uses: ./.github/actions/cleanup-and-coverage
with:
profiles: mongo
codecov-token: ${{ secrets.CODECOV_TOKEN }}
if: always()
- name: Upload logs to artifacts
uses: scality/action-artifacts@v4
with:
Expand Down Expand Up @@ -330,6 +345,12 @@ jobs:
yarn run ft_mixed_bucket_format_version | tee /tmp/artifacts/${{ github.job }}/mixed-tests.log
env:
S3_LOCATION_FILE: tests/locationConfig/locationConfigTests.json
- name: Cleanup and upload coverage
uses: ./.github/actions/cleanup-and-coverage
with:
profiles: mongo
codecov-token: ${{ secrets.CODECOV_TOKEN }}
if: always()
- name: Upload logs to artifacts
uses: scality/action-artifacts@v4
with:
Expand Down Expand Up @@ -373,6 +394,12 @@ jobs:
set -o pipefail;
bash wait_for_local_port.bash 8000 40
yarn run ft_test | tee /tmp/artifacts/${{ matrix.job-name }}/tests.log
- name: Cleanup and upload coverage
uses: ./.github/actions/cleanup-and-coverage
with:
codecov-token: ${{ secrets.CODECOV_TOKEN }}
flags: ${{ matrix.job-name }}
if: always()
- name: Upload logs to artifacts
uses: scality/action-artifacts@v4
with:
Expand Down Expand Up @@ -407,6 +434,11 @@ jobs:
set -ex -o pipefail;
bash wait_for_local_port.bash 8000 40
yarn run test_utapi_v2 | tee /tmp/artifacts/${{ github.job }}/tests.log
- name: Cleanup and upload coverage
uses: ./.github/actions/cleanup-and-coverage
with:
codecov-token: ${{ secrets.CODECOV_TOKEN }}
if: always()
- name: Upload logs to artifacts
uses: scality/action-artifacts@v4
with:
Expand Down Expand Up @@ -451,6 +483,13 @@ jobs:
set -ex -o pipefail;
bash wait_for_local_port.bash 8000 40
yarn run test_quota | tee /tmp/artifacts/${{ github.job }}/tests.log
- name: Cleanup and upload coverage
uses: ./.github/actions/cleanup-and-coverage
with:
profiles: mongo
codecov-token: ${{ secrets.CODECOV_TOKEN }}
flags: ${{ github.job }}${{ matrix.inflights.value == 'true' && '-inflights' || '' }}
if: always()
- name: Upload logs to artifacts
uses: scality/action-artifacts@v4
with:
Expand Down Expand Up @@ -489,6 +528,12 @@ jobs:
bash wait_for_local_port.bash 8000 40
bash wait_for_local_port.bash 5696 40
yarn run ft_kmip | tee /tmp/artifacts/${{ github.job }}/tests.log
- name: Cleanup and upload coverage
uses: ./.github/actions/cleanup-and-coverage
with:
profiles: pykmip
codecov-token: ${{ secrets.CODECOV_TOKEN }}
if: always()
- name: Upload logs to artifacts
uses: scality/action-artifacts@v4
with:
Expand Down Expand Up @@ -567,6 +612,12 @@ jobs:
S3BACKEND: file
S3VAULT: mem
S3METADATA: mongodb
- name: Cleanup and upload coverage
uses: ./.github/actions/cleanup-and-coverage
with:
profiles: ceph
codecov-token: ${{ secrets.CODECOV_TOKEN }}
if: always()
- name: Upload logs to artifacts
uses: scality/action-artifacts@v4
with:
Expand Down
5 changes: 0 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ RUN yarn install --production --ignore-optional --frozen-lockfile --ignore-engin
################################################################################
FROM node:${NODE_VERSION}

RUN apt-get update && \
apt-get install -y --no-install-recommends \
jq \
&& rm -rf /var/lib/apt/lists/*

ENV NO_PROXY=localhost,127.0.0.1
ENV no_proxy=localhost,127.0.0.1

Expand Down
2 changes: 1 addition & 1 deletion lib/auth/streamingV4/V4Transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class V4Transform extends Transform {
credentialScope: this.credentialScope,
},
};
return vault.authenticateV4Request(vaultParams, null, err => {
return vault.authenticateV4Request(vaultParams, null, {}, err => {
if (err) {
this.log.trace('err from vault on streaming v4 auth',
{ error: err, paramsSentToVault: vaultParams.data });
Expand Down
Loading
Loading