openvidu/.github/workflows/backend-integration-test.yaml
Juan Carlos Moreno García 98764597e2
Add Azure Blob Storage integration (#3)
* azure-features: added azure blob support for meet

* azure-feature: removed variables of .env files

* azure-features: added azure blob support for meet

* azure-feature: removed variables of .env files

* azure-features: fix to pass the boundary ranges test

* ci update Azure storage configuration in egress.yaml using yq

* ci: update yq command for modifying egress.yaml to use correct syntax

* ci: add logging for current storage provider in backend integration tests

* ci: update conditional syntax for Azure storage provider in backend integration tests

* feature-azure: modified package-lock

* ci: remove logging of current storage provider in backend integration tests

* ci: add pre-startup script execution for Azure setup in backend integration tests

* fix: streamline pre-startup command execution for Azure storage provider

* fix: update pre-startup command script for Azure storage provider

* fix: improve pre-startup command script for Azure storage provider

* fix: remove commented instruction for modifying egress.yaml in Azure setup

* fix: streamline pre-startup command execution in backend integration tests

* fix: correct command execution syntax in backend integration tests

* fix: add container name for Azure storage provider configuration

* fix: add container name and environment variables for Azure storage configuration

* ci: enhance recordings API tests to support Azure storage provider configuration

* ci: add support for Azure storage provider in webhook, security, global preferences, participants, meetings, and users API tests

* ci: add Azure container names for various API tests in backend integration workflow

* fix: update Azure storage container names for various API tests

* backend: fix - ensure all recordings are deleted after room security tests

* ci: remove MEET_WEBHOOK_ENABLED environment variable from OpenVidu Meet setup in all jobs

* backend: refactor storage services exports

* backend: update Azure Blob Storage references and error messages for consistency

* ci: add matrix strategy for Rooms API Tests to support multiple storage providers

* backend: rename ABS services for consistency

* backend: ensure maxResults is a number in listObjectsPaginated method

* ci: update storage provider from azure to abs in integration tests

---------

Co-authored-by: Piwccle <sergiosergi11@hotmail.com>
Co-authored-by: Carlos Santos <4a.santos@gmail.com>
2025-06-23 18:34:53 +02:00

554 lines
21 KiB
YAML

name: Backend Integration Tests
on:
push:
pull_request:
workflow_dispatch:
inputs:
use-aws:
description: 'Run recording tests in AWS EC2 runner'
default: 'true'
aws-instance-type:
description: 'AWS EC2 instance type'
default: 'c5.2xlarge'
jobs:
start-aws-runner:
name: Prepare AWS runner
runs-on: ov-actions-runner
if: ${{ inputs.use-aws != 'false' }}
outputs:
label: ${{ steps.start-ec2-runner.outputs.label }}
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
steps:
- name: Start AWS EC2 Runner
id: start-ec2-runner
uses: OpenVidu/actions/start-aws-runner@main
with:
aws-instance-type: ${{ inputs.aws-instance-type || 'c5.2xlarge' }}
aws-access-key-id: ${{ vars.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
github-token: ${{ secrets.OPENVIDU_GITHUB_TOKEN }}
ec2-image-id: ${{ vars.AWS_GITHUB_ACTIONS_AMI }}
subnet-id: ${{ vars.AWS_SUBNET_ID }}
security-group-id: ${{ vars.AWS_SECURITY_GROUP_ID }}
workflow-name: ${{ github.workflow }}
repository-name: ${{ github.repository }}
test-rooms:
name: Rooms API Tests
runs-on: ov-actions-runner
strategy:
fail-fast: false
matrix:
storage-provider: [s3, abs]
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.13'
- name: Install LK CLI
run: curl -sSL https://get.livekit.io/cli | bash
- name: Setup OpenVidu Local Deployment
uses: OpenVidu/actions/start-openvidu-local-deployment@main
with:
ref-openvidu-local-deployment: development
pre_startup_commands: |
cat <<'BASH' > pre_startup_commands.sh
#!/bin/bash
if [[ "${{ matrix['storage-provider'] }}" == "abs" ]]; then
echo "Using Azure storage provider"
yq e -i '
del(.storage.s3) |
.storage.azure = {
"account_name": "${{ vars.MEET_AZURE_ACCOUNT_NAME }}",
"account_key": "${{ secrets.MEET_AZURE_ACCOUNT_KEY }}",
"container_name": "openvidu-appdata-rooms"
}
' egress.yaml
fi
BASH
chmod +x pre_startup_commands.sh && ./pre_startup_commands.sh
- name: Setup OpenVidu Meet
uses: OpenVidu/actions/start-openvidu-meet@main
env:
MEET_PREFERENCES_STORAGE_MODE: ${{ matrix.storage-provider }}
MEET_AZURE_ACCOUNT_NAME: ${{ vars.MEET_AZURE_ACCOUNT_NAME }}
MEET_AZURE_ACCOUNT_KEY: ${{ secrets.MEET_AZURE_ACCOUNT_KEY }}
MEET_AZURE_CONTAINER_NAME: "openvidu-appdata-rooms"
- name: Run tests
run: |
cd backend
npm run test:integration-rooms
env:
MEET_PREFERENCES_STORAGE_MODE: ${{ matrix.storage-provider }}
MEET_AZURE_ACCOUNT_NAME: ${{ vars.MEET_AZURE_ACCOUNT_NAME }}
MEET_AZURE_ACCOUNT_KEY: ${{ secrets.MEET_AZURE_ACCOUNT_KEY }}
MEET_AZURE_CONTAINER_NAME: "openvidu-appdata-rooms"
JEST_JUNIT_OUTPUT_DIR: './reports/'
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: '**/reports/junit.xml'
fail_on_failure: true
require_tests: true
- name: Clean up
if: always()
uses: OpenVidu/actions/cleanup@main
test-recordings:
name: Recordings API Tests
needs: start-aws-runner
if: ${{ always() && (needs.start-aws-runner.result == 'success' || needs.start-aws-runner.result == 'skipped') }}
runs-on: ${{ needs.start-aws-runner.outputs.label || 'ov-actions-runner' }}
strategy:
fail-fast: false
matrix:
storage-provider: [s3, abs]
timeout-minutes: 30
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.13'
- name: Install LK CLI
run: curl -sSL https://get.livekit.io/cli | bash
- name: Setup OpenVidu Local Deployment
uses: OpenVidu/actions/start-openvidu-local-deployment@main
with:
ref-openvidu-local-deployment: development
pre_startup_commands: |
cat <<'BASH' > pre_startup_commands.sh
#!/bin/bash
if [[ "${{ matrix['storage-provider'] }}" == "abs" ]]; then
echo "Using Azure storage provider"
yq e -i '
del(.storage.s3) |
.storage.azure = {
"account_name": "${{ vars.MEET_AZURE_ACCOUNT_NAME }}",
"account_key": "${{ secrets.MEET_AZURE_ACCOUNT_KEY }}",
"container_name": "openvidu-appdata-recordings"
}
' egress.yaml
fi
BASH
chmod +x pre_startup_commands.sh && ./pre_startup_commands.sh
- name: Setup OpenVidu Meet
uses: OpenVidu/actions/start-openvidu-meet@main
env:
MEET_PREFERENCES_STORAGE_MODE: ${{ matrix.storage-provider }}
MEET_AZURE_ACCOUNT_NAME: ${{ vars.MEET_AZURE_ACCOUNT_NAME }}
MEET_AZURE_ACCOUNT_KEY: ${{ secrets.MEET_AZURE_ACCOUNT_KEY }}
MEET_AZURE_CONTAINER_NAME: "openvidu-appdata-recordings"
- name: Run tests
run: |
cd backend
npm run test:integration-recordings
env:
MEET_PREFERENCES_STORAGE_MODE: ${{ matrix.storage-provider }}
MEET_AZURE_ACCOUNT_NAME: ${{ vars.MEET_AZURE_ACCOUNT_NAME }}
MEET_AZURE_ACCOUNT_KEY: ${{ secrets.MEET_AZURE_ACCOUNT_KEY }}
MEET_AZURE_CONTAINER_NAME: "openvidu-appdata-recordings"
JEST_JUNIT_OUTPUT_DIR: './reports/'
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: '**/reports/junit.xml'
fail_on_failure: true
require_tests: true
- name: Clean up
if: always()
uses: OpenVidu/actions/cleanup@main
test-webhooks:
name: Webhook Tests
runs-on: ov-actions-runner
strategy:
fail-fast: false
matrix:
storage-provider: [s3, abs]
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.13'
- name: Install LK CLI
run: curl -sSL https://get.livekit.io/cli | bash
- name: Setup OpenVidu Local Deployment
uses: OpenVidu/actions/start-openvidu-local-deployment@main
with:
ref-openvidu-local-deployment: development
pre_startup_commands: |
cat <<'BASH' > pre_startup_commands.sh
#!/bin/bash
if [[ "${{ matrix['storage-provider'] }}" == "abs" ]]; then
echo "Using Azure storage provider"
yq e -i '
del(.storage.s3) |
.storage.azure = {
"account_name": "${{ vars.MEET_AZURE_ACCOUNT_NAME }}",
"account_key": "${{ secrets.MEET_AZURE_ACCOUNT_KEY }}",
"container_name": "openvidu-appdata-webhooks"
}
' egress.yaml
fi
BASH
chmod +x pre_startup_commands.sh && ./pre_startup_commands.sh
- name: Setup OpenVidu Meet
uses: OpenVidu/actions/start-openvidu-meet@main
env:
MEET_PREFERENCES_STORAGE_MODE: ${{ matrix.storage-provider }}
MEET_AZURE_ACCOUNT_NAME: ${{ vars.MEET_AZURE_ACCOUNT_NAME }}
MEET_AZURE_ACCOUNT_KEY: ${{ secrets.MEET_AZURE_ACCOUNT_KEY }}
MEET_AZURE_CONTAINER_NAME: "openvidu-appdata-webhooks"
- name: Run tests
run: |
cd backend
npm run test:integration-webhooks
env:
MEET_PREFERENCES_STORAGE_MODE: ${{ matrix.storage-provider }}
MEET_AZURE_ACCOUNT_NAME: ${{ vars.MEET_AZURE_ACCOUNT_NAME }}
MEET_AZURE_ACCOUNT_KEY: ${{ secrets.MEET_AZURE_ACCOUNT_KEY }}
MEET_AZURE_CONTAINER_NAME: "openvidu-appdata-webhooks"
JEST_JUNIT_OUTPUT_DIR: './reports/'
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: '**/reports/junit.xml'
fail_on_failure: true
require_tests: true
- name: Clean up
if: always()
uses: OpenVidu/actions/cleanup@main
test-security:
name: Security API Tests
runs-on: ov-actions-runner
strategy:
fail-fast: false
matrix:
storage-provider: [s3, abs]
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.13'
- name: Install LK CLI
run: curl -sSL https://get.livekit.io/cli | bash
- name: Setup OpenVidu Local Deployment
uses: OpenVidu/actions/start-openvidu-local-deployment@main
with:
ref-openvidu-local-deployment: development
pre_startup_commands: |
cat <<'BASH' > pre_startup_commands.sh
#!/bin/bash
if [[ "${{ matrix['storage-provider'] }}" == "abs" ]]; then
echo "Using Azure storage provider"
yq e -i '
del(.storage.s3) |
.storage.azure = {
"account_name": "${{ vars.MEET_AZURE_ACCOUNT_NAME }}",
"account_key": "${{ secrets.MEET_AZURE_ACCOUNT_KEY }}",
"container_name": "openvidu-appdata-security"
}
' egress.yaml
fi
BASH
chmod +x pre_startup_commands.sh && ./pre_startup_commands.sh
- name: Setup OpenVidu Meet
uses: OpenVidu/actions/start-openvidu-meet@main
env:
MEET_PREFERENCES_STORAGE_MODE: ${{ matrix.storage-provider }}
MEET_AZURE_ACCOUNT_NAME: ${{ vars.MEET_AZURE_ACCOUNT_NAME }}
MEET_AZURE_ACCOUNT_KEY: ${{ secrets.MEET_AZURE_ACCOUNT_KEY }}
MEET_AZURE_CONTAINER_NAME: "openvidu-appdata-security"
- name: Run tests
run: |
cd backend
npm run test:integration-security
env:
MEET_PREFERENCES_STORAGE_MODE: ${{ matrix.storage-provider }}
MEET_AZURE_ACCOUNT_NAME: ${{ vars.MEET_AZURE_ACCOUNT_NAME }}
MEET_AZURE_ACCOUNT_KEY: ${{ secrets.MEET_AZURE_ACCOUNT_KEY }}
MEET_AZURE_CONTAINER_NAME: "openvidu-appdata-security"
JEST_JUNIT_OUTPUT_DIR: './reports/'
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: '**/reports/junit.xml'
fail_on_failure: true
require_tests: true
- name: Clean up
if: always()
uses: OpenVidu/actions/cleanup@main
test-global-preferences:
name: Global Preferences API Tests
runs-on: ov-actions-runner
strategy:
fail-fast: false
matrix:
storage-provider: [s3, abs]
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.13'
- name: Install LK CLI
run: curl -sSL https://get.livekit.io/cli | bash
- name: Setup OpenVidu Local Deployment
uses: OpenVidu/actions/start-openvidu-local-deployment@main
with:
ref-openvidu-local-deployment: development
pre_startup_commands: |
cat <<'BASH' > pre_startup_commands.sh
#!/bin/bash
if [[ "${{ matrix['storage-provider'] }}" == "abs" ]]; then
echo "Using Azure storage provider"
yq e -i '
del(.storage.s3) |
.storage.azure = {
"account_name": "${{ vars.MEET_AZURE_ACCOUNT_NAME }}",
"account_key": "${{ secrets.MEET_AZURE_ACCOUNT_KEY }}",
"container_name": "openvidu-appdata-global-preferences"
}
' egress.yaml
fi
BASH
chmod +x pre_startup_commands.sh && ./pre_startup_commands.sh
- name: Setup OpenVidu Meet
uses: OpenVidu/actions/start-openvidu-meet@main
env:
MEET_PREFERENCES_STORAGE_MODE: ${{ matrix.storage-provider }}
MEET_AZURE_ACCOUNT_NAME: ${{ vars.MEET_AZURE_ACCOUNT_NAME }}
MEET_AZURE_ACCOUNT_KEY: ${{ secrets.MEET_AZURE_ACCOUNT_KEY }}
MEET_AZURE_CONTAINER_NAME: "openvidu-appdata-global-preferences"
- name: Run tests
run: |
cd backend
npm run test:integration-global-preferences
env:
MEET_PREFERENCES_STORAGE_MODE: ${{ matrix.storage-provider }}
MEET_AZURE_ACCOUNT_NAME: ${{ vars.MEET_AZURE_ACCOUNT_NAME }}
MEET_AZURE_ACCOUNT_KEY: ${{ secrets.MEET_AZURE_ACCOUNT_KEY }}
MEET_AZURE_CONTAINER_NAME: "openvidu-appdata-global-preferences"
JEST_JUNIT_OUTPUT_DIR: './reports/'
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: '**/reports/junit.xml'
fail_on_failure: true
require_tests: true
- name: Clean up
if: always()
uses: OpenVidu/actions/cleanup@main
test-participants:
name: Participants API Tests
runs-on: ov-actions-runner
strategy:
fail-fast: false
matrix:
storage-provider: [s3, abs]
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.13'
- name: Install LK CLI
run: curl -sSL https://get.livekit.io/cli | bash
- name: Setup OpenVidu Local Deployment
uses: OpenVidu/actions/start-openvidu-local-deployment@main
with:
ref-openvidu-local-deployment: development
pre_startup_commands: |
cat <<'BASH' > pre_startup_commands.sh
#!/bin/bash
if [[ "${{ matrix['storage-provider'] }}" == "abs" ]]; then
echo "Using Azure storage provider"
yq e -i '
del(.storage.s3) |
.storage.azure = {
"account_name": "${{ vars.MEET_AZURE_ACCOUNT_NAME }}",
"account_key": "${{ secrets.MEET_AZURE_ACCOUNT_KEY }}",
"container_name": "openvidu-appdata-participants"
}
' egress.yaml
fi
BASH
chmod +x pre_startup_commands.sh && ./pre_startup_commands.sh
- name: Setup OpenVidu Meet
uses: OpenVidu/actions/start-openvidu-meet@main
env:
MEET_PREFERENCES_STORAGE_MODE: ${{ matrix.storage-provider }}
MEET_AZURE_ACCOUNT_NAME: ${{ vars.MEET_AZURE_ACCOUNT_NAME }}
MEET_AZURE_ACCOUNT_KEY: ${{ secrets.MEET_AZURE_ACCOUNT_KEY }}
MEET_AZURE_CONTAINER_NAME: "openvidu-appdata-participants"
- name: Run tests
run: |
cd backend
npm run test:integration-participants
env:
MEET_PREFERENCES_STORAGE_MODE: ${{ matrix.storage-provider }}
MEET_AZURE_ACCOUNT_NAME: ${{ vars.MEET_AZURE_ACCOUNT_NAME }}
MEET_AZURE_ACCOUNT_KEY: ${{ secrets.MEET_AZURE_ACCOUNT_KEY }}
MEET_AZURE_CONTAINER_NAME: "openvidu-appdata-participants"
JEST_JUNIT_OUTPUT_DIR: './reports/'
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: '**/reports/junit.xml'
fail_on_failure: true
require_tests: true
- name: Clean up
if: always()
uses: OpenVidu/actions/cleanup@main
test-meetings:
name: Meetings API Tests
runs-on: ov-actions-runner
strategy:
fail-fast: false
matrix:
storage-provider: [s3, abs]
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.13'
- name: Install LK CLI
run: curl -sSL https://get.livekit.io/cli | bash
- name: Setup OpenVidu Local Deployment
uses: OpenVidu/actions/start-openvidu-local-deployment@main
with:
ref-openvidu-local-deployment: development
pre_startup_commands: |
cat <<'BASH' > pre_startup_commands.sh
#!/bin/bash
if [[ "${{ matrix['storage-provider'] }}" == "abs" ]]; then
echo "Using Azure storage provider"
yq e -i '
del(.storage.s3) |
.storage.azure = {
"account_name": "${{ vars.MEET_AZURE_ACCOUNT_NAME }}",
"account_key": "${{ secrets.MEET_AZURE_ACCOUNT_KEY }}",
"container_name": "openvidu-appdata-meetings"
}
' egress.yaml
fi
BASH
chmod +x pre_startup_commands.sh && ./pre_startup_commands.sh
- name: Setup OpenVidu Meet
uses: OpenVidu/actions/start-openvidu-meet@main
env:
MEET_PREFERENCES_STORAGE_MODE: ${{ matrix.storage-provider }}
MEET_AZURE_ACCOUNT_NAME: ${{ vars.MEET_AZURE_ACCOUNT_NAME }}
MEET_AZURE_ACCOUNT_KEY: ${{ secrets.MEET_AZURE_ACCOUNT_KEY }}
MEET_AZURE_CONTAINER_NAME: "openvidu-appdata-meetings"
- name: Run tests
run: |
cd backend
npm run test:integration-meetings
env:
MEET_PREFERENCES_STORAGE_MODE: ${{ matrix.storage-provider }}
MEET_AZURE_ACCOUNT_NAME: ${{ vars.MEET_AZURE_ACCOUNT_NAME }}
MEET_AZURE_ACCOUNT_KEY: ${{ secrets.MEET_AZURE_ACCOUNT_KEY }}
MEET_AZURE_CONTAINER_NAME: "openvidu-appdata-meetings"
JEST_JUNIT_OUTPUT_DIR: './reports/'
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: '**/reports/junit.xml'
fail_on_failure: true
require_tests: true
- name: Clean up
if: always()
uses: OpenVidu/actions/cleanup@main
test-users:
name: Users API Tests
runs-on: ov-actions-runner
strategy:
fail-fast: false
matrix:
storage-provider: [s3, abs]
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.13'
- name: Install LK CLI
run: curl -sSL https://get.livekit.io/cli | bash
- name: Setup OpenVidu Local Deployment
uses: OpenVidu/actions/start-openvidu-local-deployment@main
with:
ref-openvidu-local-deployment: development
pre_startup_commands: |
cat <<'BASH' > pre_startup_commands.sh
#!/bin/bash
if [[ "${{ matrix['storage-provider'] }}" == "abs" ]]; then
echo "Using Azure storage provider"
yq e -i '
del(.storage.s3) |
.storage.azure = {
"account_name": "${{ vars.MEET_AZURE_ACCOUNT_NAME }}",
"account_key": "${{ secrets.MEET_AZURE_ACCOUNT_KEY }}",
"container_name": "openvidu-appdata-users"
}
' egress.yaml
fi
BASH
chmod +x pre_startup_commands.sh && ./pre_startup_commands.sh
- name: Setup OpenVidu Meet
uses: OpenVidu/actions/start-openvidu-meet@main
env:
MEET_PREFERENCES_STORAGE_MODE: ${{ matrix.storage-provider }}
MEET_AZURE_ACCOUNT_NAME: ${{ vars.MEET_AZURE_ACCOUNT_NAME }}
MEET_AZURE_ACCOUNT_KEY: ${{ secrets.MEET_AZURE_ACCOUNT_KEY }}
MEET_AZURE_CONTAINER_NAME: "openvidu-appdata-users"
- name: Run tests
run: |
cd backend
npm run test:integration-users
env:
MEET_PREFERENCES_STORAGE_MODE: ${{ matrix.storage-provider }}
MEET_AZURE_ACCOUNT_NAME: ${{ vars.MEET_AZURE_ACCOUNT_NAME }}
MEET_AZURE_ACCOUNT_KEY: ${{ secrets.MEET_AZURE_ACCOUNT_KEY }}
MEET_AZURE_CONTAINER_NAME: "openvidu-appdata-users"
JEST_JUNIT_OUTPUT_DIR: './reports/'
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: '**/reports/junit.xml'
fail_on_failure: true
require_tests: true
- name: Clean up
if: always()
uses: OpenVidu/actions/cleanup@main
stop-runner:
name: Stop EC2 runner
needs:
- start-aws-runner
- test-recordings
runs-on: ov-actions-runner
if: ${{ always() && needs.start-aws-runner.outputs.label != '' }}
steps:
- name: Stop AWS EC2 Runner
id: stop-ec2-runner
uses: OpenVidu/actions/stop-aws-runner@main
with:
aws-access-key-id: ${{ vars.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
github-token: ${{ secrets.OPENVIDU_GITHUB_TOKEN }}
label: ${{ needs.start-aws-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-aws-runner.outputs.ec2-instance-id }}