ci: Refactor integration test workflow to streamline setup and improve wait logic
This commit is contained in:
parent
e41bb8830a
commit
ef68f2a2f1
131
.github/workflows/integration-test.yaml
vendored
131
.github/workflows/integration-test.yaml
vendored
@ -6,6 +6,16 @@ jobs:
|
|||||||
name: Rooms API Tests
|
name: Rooms API Tests
|
||||||
runs-on: ov-actions-runner
|
runs-on: ov-actions-runner
|
||||||
steps:
|
steps:
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
|
- name: Setup yarn # Needed for the redlock package
|
||||||
|
run: npm install -g yarn
|
||||||
|
- name: Install wait-on
|
||||||
|
run: npm install -g wait-on
|
||||||
|
- name: Install LK CLI
|
||||||
|
run: curl -sSL https://get.livekit.io/cli | bash
|
||||||
- name: Checkout OpenVidu Local Deployment
|
- name: Checkout OpenVidu Local Deployment
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@ -19,35 +29,9 @@ jobs:
|
|||||||
cd openvidu-local-deployment/community
|
cd openvidu-local-deployment/community
|
||||||
./configure_lan_private_ip_linux.sh
|
./configure_lan_private_ip_linux.sh
|
||||||
docker compose up -d
|
docker compose up -d
|
||||||
|
|
||||||
- name: Wait for OpenVidu Local Deployment to Start
|
- name: Wait for OpenVidu Local Deployment to Start
|
||||||
shell: bash
|
run: wait-on --timeout 60000 http://localhost:7880
|
||||||
run: |
|
|
||||||
MAX_WAIT_SECONDS=60
|
|
||||||
SECONDS=0
|
|
||||||
until curl -s -f -o /dev/null http://localhost:7880; do
|
|
||||||
if [ $SECONDS -gt $MAX_WAIT_SECONDS ]; then
|
|
||||||
echo "OpenVidu Local Deployment did not start in $MAX_WAIT_SECONDS seconds"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "Waiting for openvidu-local-deployment to be ready ..."
|
|
||||||
sleep 5
|
|
||||||
SECONDS=$((SECONDS+5))
|
|
||||||
done
|
|
||||||
echo "OpenVidu Local Deployment started in $SECONDS seconds"
|
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Setup Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: '20'
|
|
||||||
- name: Setup yarn # Needed for the redlock package
|
|
||||||
run: npm install -g yarn
|
|
||||||
- name: Install wait-on
|
|
||||||
run: npm install -g wait-on
|
|
||||||
- name: Install LK CLI
|
|
||||||
run: |
|
|
||||||
curl -sSL https://get.livekit.io/cli | bash
|
|
||||||
- name: Setup OpenVidu Meet
|
- name: Setup OpenVidu Meet
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@ -74,7 +58,18 @@ jobs:
|
|||||||
test-recordings:
|
test-recordings:
|
||||||
name: Recordings API Tests
|
name: Recordings API Tests
|
||||||
runs-on: ov-actions-runner
|
runs-on: ov-actions-runner
|
||||||
|
if: false
|
||||||
steps:
|
steps:
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
|
- name: Setup yarn # Needed for the redlock package
|
||||||
|
run: npm install -g yarn
|
||||||
|
- name: Install wait-on
|
||||||
|
run: npm install -g wait-on
|
||||||
|
- name: Install LK CLI
|
||||||
|
run: curl -sSL https://get.livekit.io/cli | bash
|
||||||
- name: Checkout OpenVidu Local Deployment
|
- name: Checkout OpenVidu Local Deployment
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@ -90,33 +85,8 @@ jobs:
|
|||||||
docker compose up -d
|
docker compose up -d
|
||||||
|
|
||||||
- name: Wait for OpenVidu Local Deployment to Start
|
- name: Wait for OpenVidu Local Deployment to Start
|
||||||
shell: bash
|
run: wait-on --timeout 60000 http://localhost:7880
|
||||||
run: |
|
|
||||||
MAX_WAIT_SECONDS=60
|
|
||||||
SECONDS=0
|
|
||||||
until curl -s -f -o /dev/null http://localhost:7880; do
|
|
||||||
if [ $SECONDS -gt $MAX_WAIT_SECONDS ]; then
|
|
||||||
echo "OpenVidu Local Deployment did not start in $MAX_WAIT_SECONDS seconds"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "Waiting for openvidu-local-deployment to be ready ..."
|
|
||||||
sleep 5
|
|
||||||
SECONDS=$((SECONDS+5))
|
|
||||||
done
|
|
||||||
echo "OpenVidu Local Deployment started in $SECONDS seconds"
|
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Setup Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: '20'
|
|
||||||
- name: Setup yarn # Needed for the redlock package
|
|
||||||
run: npm install -g yarn
|
|
||||||
- name: Install wait-on
|
|
||||||
run: npm install -g wait-on
|
|
||||||
- name: Install LK CLI
|
|
||||||
run: |
|
|
||||||
curl -sSL https://get.livekit.io/cli | bash
|
|
||||||
- name: Setup OpenVidu Meet
|
- name: Setup OpenVidu Meet
|
||||||
run: |
|
run: |
|
||||||
./prepare.sh
|
./prepare.sh
|
||||||
@ -124,7 +94,6 @@ jobs:
|
|||||||
npm install
|
npm install
|
||||||
npm run start:prod &
|
npm run start:prod &
|
||||||
- name: Wait for OpenVidu Meet to Start
|
- name: Wait for OpenVidu Meet to Start
|
||||||
shell: bash
|
|
||||||
run: wait-on --timeout 30000 http://localhost:6080/meet/health
|
run: wait-on --timeout 30000 http://localhost:6080/meet/health
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
@ -139,3 +108,57 @@ jobs:
|
|||||||
report_paths: '**/reports/junit.xml'
|
report_paths: '**/reports/junit.xml'
|
||||||
fail_on_failure: true
|
fail_on_failure: true
|
||||||
require_tests: true
|
require_tests: true
|
||||||
|
|
||||||
|
test-security:
|
||||||
|
name: Security API Tests
|
||||||
|
runs-on: ov-actions-runner
|
||||||
|
if: false
|
||||||
|
steps:
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
|
- name: Setup yarn # Needed for the redlock package
|
||||||
|
run: npm install -g yarn
|
||||||
|
- name: Install wait-on
|
||||||
|
run: npm install -g wait-on
|
||||||
|
- name: Install LK CLI
|
||||||
|
run: curl -sSL https://get.livekit.io/cli | bash
|
||||||
|
- name: Checkout OpenVidu Local Deployment
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: OpenVidu/openvidu-local-deployment
|
||||||
|
ref: development
|
||||||
|
path: openvidu-local-deployment
|
||||||
|
|
||||||
|
- name: Configure Local Deployment
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cd openvidu-local-deployment/community
|
||||||
|
./configure_lan_private_ip_linux.sh
|
||||||
|
docker compose up -d
|
||||||
|
|
||||||
|
- name: Wait for OpenVidu Local Deployment to Start
|
||||||
|
run: wait-on --timeout 60000 http://localhost:7880
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Setup OpenVidu Meet
|
||||||
|
run: |
|
||||||
|
./prepare.sh
|
||||||
|
cd backend
|
||||||
|
npm install
|
||||||
|
npm run start:prod &
|
||||||
|
- name: Wait for OpenVidu Meet to Start
|
||||||
|
run: wait-on --timeout 30000 http://localhost:6080/meet/health
|
||||||
|
- name: Run tests
|
||||||
|
run: |
|
||||||
|
cd backend
|
||||||
|
npm run test:integration-security
|
||||||
|
env:
|
||||||
|
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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user