reconfigure tests environment
This commit is contained in:
parent
af7f2799c0
commit
bd3a7b8af0
62
.github/workflows/CI.yml
vendored
62
.github/workflows/CI.yml
vendored
@ -89,9 +89,67 @@ jobs:
|
|||||||
node-modules-
|
node-modules-
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm install
|
run: npm install
|
||||||
|
- name: Install Chrome
|
||||||
|
uses: browser-actions/setup-chrome@latest
|
||||||
|
with:
|
||||||
|
chrome-version: stable
|
||||||
- name: Install Chrome dependencies
|
- name: Install Chrome dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y libgbm-dev libasound2t64 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 libgbm1
|
sudo apt-get install -y \
|
||||||
|
libgbm-dev \
|
||||||
|
libasound2 \
|
||||||
|
libatk1.0-0 \
|
||||||
|
libc6 \
|
||||||
|
libcairo2 \
|
||||||
|
libcups2 \
|
||||||
|
libdbus-1-3 \
|
||||||
|
libexpat1 \
|
||||||
|
libfontconfig1 \
|
||||||
|
libgcc1 \
|
||||||
|
libgdk-pixbuf2.0-0 \
|
||||||
|
libglib2.0-0 \
|
||||||
|
libgtk-3-0 \
|
||||||
|
libnspr4 \
|
||||||
|
libpango-1.0-0 \
|
||||||
|
libpangocairo-1.0-0 \
|
||||||
|
libstdc++6 \
|
||||||
|
libx11-6 \
|
||||||
|
libx11-xcb1 \
|
||||||
|
libxcb1 \
|
||||||
|
libxcomposite1 \
|
||||||
|
libxcursor1 \
|
||||||
|
libxdamage1 \
|
||||||
|
libxext6 \
|
||||||
|
libxfixes3 \
|
||||||
|
libxi6 \
|
||||||
|
libxrandr2 \
|
||||||
|
libxrender1 \
|
||||||
|
libxss1 \
|
||||||
|
libxtst6 \
|
||||||
|
libgbm1
|
||||||
|
- name: Set Chrome flags
|
||||||
|
run: |
|
||||||
|
echo "CHROME_FLAGS=--enable-features=SharedArrayBuffer,CrossOriginIsolation --enable-experimental-web-platform-features --cross-origin-isolated --allow-file-access-from-files --disable-web-security --allow-insecure-localhost --no-sandbox --disable-setuid-sandbox --enable-unsafe-webgpu --disable-gpu-sandbox" >> $GITHUB_ENV
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: npm test
|
env:
|
||||||
|
CHROME_HEADLESS: 1
|
||||||
|
CHROME_PATH: chrome
|
||||||
|
run: |
|
||||||
|
# Start test server with proper headers
|
||||||
|
npm run serve &
|
||||||
|
|
||||||
|
# Wait for server to be ready
|
||||||
|
npx wait-on http://localhost:3000
|
||||||
|
|
||||||
|
# Run tests with configured Chrome flags
|
||||||
|
npx mocha-headless-chrome \
|
||||||
|
--args="$CHROME_FLAGS" \
|
||||||
|
-a no-sandbox \
|
||||||
|
--chrome-path="$(which chrome)" \
|
||||||
|
-f http://localhost:3000/tests/ffmpeg-core-mt.test.html
|
||||||
|
|
||||||
|
# Run remaining tests
|
||||||
|
npm run test:browser:core:st
|
||||||
|
npm run test:browser:ffmpeg:mt
|
||||||
|
npm run test:browser:ffmpeg:st
|
||||||
|
@ -7,10 +7,10 @@
|
|||||||
"lint:root": "eslint tests",
|
"lint:root": "eslint tests",
|
||||||
"build": "npm run build --workspace=packages --if-present",
|
"build": "npm run build --workspace=packages --if-present",
|
||||||
"pretest": "npm run build",
|
"pretest": "npm run build",
|
||||||
"serve": "http-server -c-1 -s -p 3000 . --cors --headers '{\"Cross-Origin-Embedder-Policy\":\"require-corp\",\"Cross-Origin-Opener-Policy\":\"same-origin\",\"Cross-Origin-Resource-Policy\":\"cross-origin\"}'",
|
"serve": "http-server -c-1 -s -p 3000 . --cors --headers '{\"Cross-Origin-Embedder-Policy\":\"require-corp\",\"Cross-Origin-Opener-Policy\":\"same-origin\",\"Cross-Origin-Resource-Policy\":\"cross-origin\",\"Origin-Agent-Cluster\":\"?1\"}'",
|
||||||
"test": "server-test test:browser:server 3000 test:all",
|
"test": "server-test test:browser:server 3000 test:all",
|
||||||
"test:all": "npm-run-all test:browser:*:*",
|
"test:all": "npm-run-all test:browser:*:*",
|
||||||
"test:browser": "mocha-headless-chrome --args=\"--enable-features=SharedArrayBuffer --enable-experimental-web-platform-features --cross-origin-isolated --allow-file-access-from-files --disable-web-security --allow-insecure-localhost --no-sandbox --disable-setuid-sandbox\" -a no-sandbox",
|
"test:browser": "mocha-headless-chrome --args=\"$CHROME_FLAGS\" -a no-sandbox",
|
||||||
"test:browser:core:mt": "npm run test:browser -- -f http://localhost:3000/tests/ffmpeg-core-mt.test.html",
|
"test:browser:core:mt": "npm run test:browser -- -f http://localhost:3000/tests/ffmpeg-core-mt.test.html",
|
||||||
"test:browser:core:st": "npm run test:browser -- -f http://localhost:3000/tests/ffmpeg-core-st.test.html",
|
"test:browser:core:st": "npm run test:browser -- -f http://localhost:3000/tests/ffmpeg-core-st.test.html",
|
||||||
"test:browser:ffmpeg:mt": "npm run test:browser -- -f http://localhost:3000/tests/ffmpeg-mt.test.html",
|
"test:browser:ffmpeg:mt": "npm run test:browser -- -f http://localhost:3000/tests/ffmpeg-mt.test.html",
|
||||||
@ -20,8 +20,7 @@
|
|||||||
"test:node:core:mt": "npm run test:node -- --require tests/test-helper-mt.js tests/ffmpeg-core.test.js",
|
"test:node:core:mt": "npm run test:node -- --require tests/test-helper-mt.js tests/ffmpeg-core.test.js",
|
||||||
"test:node:core:st": "npm run test:node -- --require tests/test-helper-st.js tests/ffmpeg-core.test.js",
|
"test:node:core:st": "npm run test:node -- --require tests/test-helper-st.js tests/ffmpeg-core.test.js",
|
||||||
"prepublishOnly": "npm run build",
|
"prepublishOnly": "npm run build",
|
||||||
"postinstall": "npm run build",
|
"postinstall": "npm run build"
|
||||||
"test:environment": "npm run serve & wait-on http://localhost:3000 && mocha-headless-chrome --args=\"--enable-features=SharedArrayBuffer --enable-experimental-web-platform-features --cross-origin-isolated --allow-file-access-from-files\" -a no-sandbox -f http://localhost:3000/tests/environment-check.test.html"
|
|
||||||
},
|
},
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"packages/*",
|
"packages/*",
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<title>Environment Check</title>
|
|
||||||
<link rel="stylesheet" href="../node_modules/mocha/mocha.css" />
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="mocha"></div>
|
|
||||||
<script src="../node_modules/mocha/mocha.js"></script>
|
|
||||||
<script src="../node_modules/chai/chai.js"></script>
|
|
||||||
<script>
|
|
||||||
mocha.setup("bdd");
|
|
||||||
window.expect = chai.expect;
|
|
||||||
</script>
|
|
||||||
<script src="./environment-check.test.js"></script>
|
|
||||||
<script>
|
|
||||||
mocha.run();
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Loading…
Reference in New Issue
Block a user