Skip to content
Open
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
3 changes: 3 additions & 0 deletions .env.default
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export WPT_REPORT_API_KEY=
# (Optionally) define an alternate reporting URL
export WPT_REPORT_URL=

# Path to the WP Core nightly files
export WPT_CORE_NIGHTLY_DIR=/tmp/nightly

# Credentials for a database that can be written to and reset.
# WARNING!!! This database will be destroyed between tests. Only use safe database credentials.
# Please note that you must escape _or_ refrain from using # as special character in your credentials.
Expand Down
18 changes: 18 additions & 0 deletions patch_gruntfile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
sourcefile=$1
awk '
BEGIN { inside = 0 }
/grunt\.registerTask\(.*'\''build:(js|css)'\''/ {
inside = 1
match($0, /'\''build:(js|css)'\''/, m)
task = m[1]
print "grunt.registerTask('\''build:" task "'\'', function() {"
print " grunt.log.writeln('\''Main task build:" task " is not used'\'');"
print "});"
next
}
inside && /\);/ {
inside = 0
next
}
!inside
' $sourcefile > Gruntfile.tmp && mv Gruntfile.tmp $sourcefile
11 changes: 10 additions & 1 deletion prepare.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,16 @@
'cd ' . escapeshellarg( $WPT_PREPARE_DIR . '/tests/phpunit/data/plugins/' ) . '; unzip wordpress-importer.zip; rm wordpress-importer.zip',

// Change directory to the preparation directory, install npm dependencies, and build the project.
'cd ' . escapeshellarg( $WPT_PREPARE_DIR ) . '; npm install && npm run build'
/// 'cd ' . escapeshellarg( $WPT_PREPARE_DIR ) . '; npm install && npm run build',

// Install NPM but skip the css and js build step
'cd ' . escapeshellarg( $WPT_PREPARE_DIR ) . ' && npm install && bash patch_gruntfile.sh Gruntfile.js && npm run build --force',

// Refresh nightly
'mkdir -p ' . escapeshellarg( $WPT_CORE_NIGHTLY_DIR ) . ' && cd ' . escapeshellarg( $WPT_CORE_NIGHTLY_DIR ) . ' && wp-cli core download --force --version=nightly',

// Now rsync the CSS and JS files from nightly
'cd ' . escapeshellarg( $WPT_CORE_NIGHTLY_DIR ) . ' && rsync -zarv --include="*/" --include="*.js" --include="*.css" --exclude="*" --include="*.js" --include="*.css" . '.. escapeshellarg( $WPT_PREPARE_DIR ) . '/build',

) );

Expand Down