Skip to content

Commit

Permalink
updates to aqua grunt tasks to get working, and combine Gruntfiles, p…
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Sep 30, 2024
1 parent 619fcd4 commit b4bb56d
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 107 deletions.
21 changes: 18 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
// Copyright 2017, University of Colorado Boulder
// Copyright 2017-2024, University of Colorado Boulder

/**
* Aqua-specific grunt configuration
*
* @author Jonathan Olson <jonathan.olson@colorado.edu>
*/

// use aqua's gruntfile
module.exports = require( './js/grunt/Gruntfile.js' );
// AQUA wants to opt out of global SIGINT handling so that it can handle it itself.
global.processEventOptOut = true;

const Gruntfile = require( '../chipper/js/grunt/Gruntfile' );
const registerTasks = require( '../perennial-alias/js/grunt/util/registerTasks' );

// Stream winston logging to the console
module.exports = grunt => {
Gruntfile( grunt );

registerTasks( grunt, `${__dirname}/js/grunt/tasks` );
};
20 changes: 0 additions & 20 deletions js/grunt/Gruntfile.js

This file was deleted.

37 changes: 0 additions & 37 deletions js/grunt/tasks/client-server.ts

This file was deleted.

12 changes: 4 additions & 8 deletions js/grunt/tasks/continuous-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,13 @@
*/

import assert from 'assert';
import getOption from '../../../../perennial/js/grunt/tasks/util/getOption';
import grunt from '../../../../perennial/js/import-shared/grunt';
import _ from '../../../../perennial/js/import-shared/lodash';
import winston from '../../../../perennial/js/import-shared/winston';
import ContinuousServer from '../../server/ContinuousServer';
import getOption from '../../../../perennial/js/grunt/tasks/util/getOption.js';
import _ from '../../../../perennial/js/import-shared/lodash.js';
import winston from '../../../../perennial/js/import-shared/winston.js';
import ContinuousServer from '../../server/ContinuousServer.js';

winston.default.transports.console.level = 'info';

// We don't finish! Don't tell grunt this...
grunt.task.current.async();

assert( getOption( 'localCount' ), 'Please specify --localCount=NUMBER, for specifying the number of local threads running things like grunt tasks' );

const port = getOption( 'port' ) ? Number( getOption( 'port' ) ) : 45366;
Expand Down
19 changes: 8 additions & 11 deletions js/grunt/tasks/ct-node-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,14 @@

import assert from 'assert';
import playwright from 'playwright';
import grunt from '../../../../perennial/js/import-shared/grunt';
import getOption from '../../../../perennial/js/grunt/tasks/util/getOption';
import winston from '../../../../perennial/js/import-shared/winston';
import runNextTest from '../../node-client/runNextTest';

winston.default.transports.console.level = 'info';

// We don't finish! Don't tell grunt this...
grunt.task.current.async();

const options: any = {};
const browser = grunt.option( 'browser' );
const browser = getOption( 'browser' );
if ( browser ) {

if ( browser === 'firefox' ) {
Expand All @@ -35,14 +32,14 @@ if ( browser ) {
assert( browser === 'puppeteer', 'supported browsers: puppeteer or firefox or webkit' );
}
}
if ( grunt.option( 'ctID' ) ) {
options.ctID = grunt.option( 'ctID' );
if ( getOption( 'ctID' ) ) {
options.ctID = getOption( 'ctID' );
}
if ( grunt.option( 'serverURL' ) ) {
options.serverURL = grunt.option( 'serverURL' );
if ( getOption( 'serverURL' ) ) {
options.serverURL = getOption( 'serverURL' );
}
if ( grunt.option( 'fileServerURL' ) ) {
options.fileServerURL = grunt.option( 'fileServerURL' );
if ( getOption( 'fileServerURL' ) ) {
options.fileServerURL = getOption( 'fileServerURL' );
}

winston.info( 'Starting node client' );
Expand Down
8 changes: 3 additions & 5 deletions js/grunt/tasks/quick-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,15 @@
*/

import getOption from '../../../../perennial/js/grunt/tasks/util/getOption';
import grunt from '../../../../perennial/js/import-shared/grunt';
import QuickServer from '../../server/QuickServer';

// We don't finish! Don't tell grunt this...
grunt.task.current.async();

const port = getOption( 'port' ) ? Number( getOption( 'port' ) ) : 45367;

const testing = getOption( 'testing' );
const server = new QuickServer( {
isTestMode: testing
} );
server.startServer( port );
server.startMainLoop();
server.startMainLoop().catch( e => {
throw new Error( `Error in CTQ main loop: ${e}` );
} );
23 changes: 0 additions & 23 deletions js/grunt/tasks/test-aqua-grunt.ts

This file was deleted.

0 comments on commit b4bb56d

Please sign in to comment.