Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add playback-min as a unit test type #1077

Merged
merged 1 commit into from
Feb 22, 2021
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
test-type: [unit, playback]
test-type: [unit, playback, playback-min]
env:
BROWSER_STACK_USERNAME: ${{secrets.BROWSER_STACK_USERNAME}}
BROWSER_STACK_ACCESS_KEY: ${{secrets.BROWSER_STACK_ACCESS_KEY}}
Expand Down
17 changes: 11 additions & 6 deletions scripts/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ const {terser} = require('rollup-plugin-terser');
const createTestData = require('./create-test-data.js');
const replace = require('@rollup/plugin-replace');

const CI_TEST_TYPE = process.env.CI_TEST_TYPE || '';

let syncWorker;
// see https://github.com/videojs/videojs-generate-rollup-config
// for options
Expand Down Expand Up @@ -35,6 +37,10 @@ const options = {
defaults.test.unshift('worker');
defaults.test.unshift('createTestData');

if (CI_TEST_TYPE === 'playback-min') {
defaults.test.push('uglify');
}

// istanbul is only in the list for regular builds and not watch
if (defaults.test.indexOf('istanbul') !== -1) {
defaults.test.splice(defaults.test.indexOf('istanbul'), 1);
Expand Down Expand Up @@ -84,13 +90,12 @@ const options = {
}
};

if (process.env.CI_TEST_TYPE) {
if (process.env.CI_TEST_TYPE === 'playback') {
options.testInput = 'test/playback.test.js';
} else {
options.testInput = {include: ['test/**/*.test.js'], exclude: ['test/playback.test.js']};
}
if (CI_TEST_TYPE === 'playback' || CI_TEST_TYPE === 'playback-min') {
options.testInput = 'test/playback.test.js';
} else if (CI_TEST_TYPE === 'unit') {
options.testInput = {include: ['test/**/*.test.js'], exclude: ['test/playback.test.js']};
}

const config = generate(options);

if (config.builds.browser) {
Expand Down