Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fixup! PR feedback
  • Loading branch information
timmywil committed Mar 27, 2024
commit 5289d84f7c66214b4f7fc5d91649d1874c1355ac
11 changes: 4 additions & 7 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ on:
branches-ignore: "dependabot/**"
# Once a week every Monday
schedule:
- cron: "0 0 * * 1"
- cron: "42 1 * * 1"

permissions:
contents: read

env:
NODE_VERSION: 20.x

jobs:
build-and-test:
runs-on: ubuntu-latest
name: ${{ matrix.BROWSER }} - jQuery ${{ matrix.JQUERY }}
env:
NODE_VERSION: 20.x
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -60,8 +61,6 @@ jobs:
edge:
runs-on: windows-latest
name: edge - jQuery ${{ matrix.JQUERY }}
env:
NODE_VERSION: 20.x
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -100,8 +99,6 @@ jobs:
safari:
runs-on: macos-latest
name: safari - jQuery ${{ matrix.JQUERY }}
env:
NODE_VERSION: 20.x
strategy:
fail-fast: false
matrix:
Expand Down
2 changes: 1 addition & 1 deletion tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h2>Unit Tests</h2>
<p><a href="unit/index.html">Unit tests</a> exist for all functionality in jQuery UI.
The unit tests can be run locally (some tests require a web server with PHP)
to ensure proper functionality before committing changes.
The unit tests are also run in Chrome, Firefox, and Safari on every commit.</p>
The unit tests are also run in Chrome, Firefox, Edge, and Safari on every commit.</p>

<h2>Visual Tests</h2>
<p><a href="visual/index.html">Visual tests</a> only exist in cases where we can't verify proper functionality
Expand Down
6 changes: 4 additions & 2 deletions tests/runner/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
},
"globals": {
"fetch": false,
"Promise": false
"Promise": false,
"require": false
},
"parserOptions": {
"ecmaVersion": 2022,
Expand All @@ -21,7 +22,8 @@
{
"files": ["./listeners.js"],
"env": {
"browser": true
"browser": true,
"node": false
},
"globals": {
"QUnit": false,
Expand Down
10 changes: 6 additions & 4 deletions tests/runner/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ const argv = yargs( process.argv.slice( 2 ) )
"Pass multiple versions by repeating the option.",
default: [ "3.7.1" ]
} )
.option( "migrate", {
type: "boolean",
description:
"Run tests with jQuery Migrate enabled.",
default: false
} )
.option( "browser", {
alias: "b",
type: "array",
Expand Down Expand Up @@ -57,10 +63,6 @@ const argv = yargs( process.argv.slice( 2 ) )
type: "number",
description: "Run tests in parallel in multiple browsers. Defaults to 8."
} )
.option( "run-id", {
type: "string",
description: "A unique identifier for this run."
} )
.option( "verbose", {
alias: "v",
type: "boolean",
Expand Down
6 changes: 5 additions & 1 deletion tests/runner/lib/buildTestUrl.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function buildTestUrl( suite, { jquery, port, reportId } ) {
export function buildTestUrl( suite, { jquery, migrate, port, reportId } ) {
if ( !port ) {
throw new Error( "No port specified." );
}
Expand All @@ -9,6 +9,10 @@ export function buildTestUrl( suite, { jquery, port, reportId } ) {
query.append( "jquery", jquery );
}

if ( migrate ) {
query.append( "migrate", "true" );
}

if ( reportId ) {
query.append( "reportId", reportId );
}
Expand Down
3 changes: 3 additions & 0 deletions tests/runner/listeners.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
// Serialize Symbols as string representations so they are
// sent over the wire after being stringified.
if ( typeof value === "symbol" ) {

// We can *describe* unique symbols, but note that their identity
// (e.g., `Symbol() !== Symbol()`) is lost
var ctor = Symbol.keyFor( value ) !== undefined ? "Symbol.for" : "Symbol";
return ctor + "(" + JSON.stringify( value.description ) + ")";
}
Expand Down
3 changes: 2 additions & 1 deletion tests/runner/reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,13 @@ export function reportTest( test, reportId, { browser, headless } ) {
}
}

export function reportEnd( result, reportId, { browser, headless, jquery, suite } ) {
export function reportEnd( result, reportId, { browser, headless, jquery, migrate, suite } ) {
const fullBrowser = getBrowserString( browser, headless );
console.log(
`\n\nTests finished in ${ prettyMs( result.runtime ) } ` +
`for ${ chalk.yellow( suite ) } ` +
`and jQuery ${ chalk.yellow( jquery ) } ` +
( migrate ? `with ${ chalk.yellow( "jQuery Migrate enabled " ) }` : "" ) +
`in ${ chalk.yellow( fullBrowser ) } (${ chalk.bold( reportId ) })...`
);
console.log(
Expand Down
15 changes: 5 additions & 10 deletions tests/runner/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ export async function run( {
browser: browserNames = [],
concurrency,
debug,
jquery: jquerys = [],
headless,
jquery: jquerys = [],
migrate,
suite: suites = [],
runId,
verbose
} ) {
if ( !browserNames.length ) {
Expand All @@ -45,11 +45,6 @@ export async function run( {
// Convert browser names to browser objects
let browsers = browserNames.map( ( b ) => ( { browser: b } ) );

// A unique identifier for this run
if ( !runId ) {
runId = generateHash( `${ Date.now() }-${ suites.join( ":" ) }` );
}

// Create the test app and
// hook it up to the reporter
const reports = Object.create( null );
Expand Down Expand Up @@ -153,10 +148,11 @@ export async function run( {

for ( const jquery of jquerys ) {
const reportId = generateHash( `${ suite } ${ fullBrowser }` );
reports[ reportId ] = { browser, headless, jquery, suite };
reports[ reportId ] = { browser, headless, jquery, migrate, suite };

const url = buildTestUrl( suite, {
jquery,
migrate,
port,
reportId
} );
Expand All @@ -165,8 +161,8 @@ export async function run( {
debug,
headless,
jquery,
migrate,
reportId,
runId,
suite,
verbose
};
Expand All @@ -182,7 +178,6 @@ export async function run( {
}

try {
console.log( `Starting Run ${ runId }...` );
await runAll( { concurrency, verbose } );
} catch ( error ) {
console.error( error );
Expand Down