Skip to content
This repository has been archived by the owner on Oct 14, 2020. It is now read-only.

Commit

Permalink
- removed groovyserv reference
Browse files Browse the repository at this point in the history
- code cleanup
  • Loading branch information
jhoffner committed Jul 10, 2017
1 parent 9df0faf commit 604cc31
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 20 deletions.
4 changes: 0 additions & 4 deletions docker/java.docker
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ RUN mv groovy-2.4.10 groovy
ENV GROOVY_HOME /usr/local/groovy/
ENV PATH /usr/local/groovy/bin:${PATH}

# Setup GroovyServ
RUN mv groovyserv-1.1.0 groovyserv
ENV PATH /usr/local/groovyserv/bin:${PATH}

# Install zip utils
RUN apt-get install -y zip unzip --no-install-recommends

Expand Down
8 changes: 4 additions & 4 deletions documentation/environments/java.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ Within the setup code you can load any of these packages using reference config

**Setup Example:**
```java
// @config reference guava
// @config reference commons-lang3
// @config: reference guava
// @config: reference commons-lang3
```


Expand All @@ -61,8 +61,8 @@ When including the Spring framework via `spring-boot`, if other services are con

Gradle is used as the build tool. Each time you run code, a fresh Docker container will be used. Under
typical conditions the Gradle daemon should have already loaded, causing build times to typically fall within
the 3 to 4 second range for trivial sized apps. However if the daemon has not finished loading then the build
process may take over 10 seconds to complete.
the 3 to 4 second range for trivial sized apps. However if the daemon has not finished loading then the build process
will need to wait until the daemon is ready. This should not affect output walltime but may cause delays in code execution.

# Timeout

Expand Down
8 changes: 4 additions & 4 deletions lib/runners/java.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ module.exports.run = function run(opts, cb) {
buildAndTest(runCode);
},
testIntegration: function (runCode, fail) {

fs.emptydirSync(`${opts.dir}/src`);

const fixtures = [];

if (opts.solution) {
Expand Down Expand Up @@ -63,7 +63,6 @@ module.exports.run = function run(opts, cb) {
buildAndTest(runCode);
},
transformBuffer: function (buffer) {
opts.publish('processing output');
var stdout = "", stderr = "", buildLines = [];

// both types of streams will be embedded within the gradle output, so lets break them out
Expand All @@ -89,7 +88,7 @@ module.exports.run = function run(opts, cb) {
buffer.stdout = buildOutput + stdout;

buffer.stderr += stderr;
// let's not show the noisy what went wrong text when there are build errors
// let's not show the noisy "Try:" text when there are build errors
buffer.stderr = buffer.stderr.split(/\^* Try:/m)[0];
}
});
Expand Down Expand Up @@ -157,13 +156,14 @@ module.exports.run = function run(opts, cb) {

// checks if the spring-boot reference is loaded and adds additional settings
function processReferences() {
// bump the timeout to 25 seconds if spring is activated
if ((opts.references || []).indexOf('spring-boot') >= 0) {
// bump the timeout to 25 seconds if spring is activated
opts.timeout = opts.timeout || 25000;
opts.references.push('jackson-annotations');
opts.references.push('spring-boot-starter-web');
opts.references.push('spring-boot-starter-test');

// auto include data packages if services are configured
if (opts.services) {
if (opts.services.indexOf('mongodb') >= 0) {
opts.references.push('spring-boot-starter-data-mongodb');
Expand Down
24 changes: 16 additions & 8 deletions lib/shovel.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,22 @@ function cleanup() {
spawnSync('bash', ['/runner/lib/cleanup.sh']);
}

// an extended version of spawn that does a number of additional things such as:
// - time process
// - sets a max output buffer
// - adds stdout/in to a buffer object which is passed to callback
// - publishes statuses
// - prevents the process from running too long (set via opts.timeout), defaults to language specific default
// TODO: move to own file and cleanup
// TODO: support single params object instead of long args chain (runCode already wraps with this interface)
/**
* an extended version of spawn that does a number of additional things such as:
* - time process
* - sets a max output buffer
* - adds stdout/in to a buffer object which is passed to callback
* - publishes statuses
* - prevents the process from running too long (set via opts.timeout), defaults to language specific default
* TODO: move to own file and cleanup
* TODO: support single params object instead of long args chain (runCode already wraps with this interface)
* @param opts {{timeout: number, language: string}}
* @param name String command executable name
* @param args Array args to be passed to executable
* @param processOptions Object spawn options
* @param processStdin String stdin to be sent to executable
* @param cb
*/
function spawnEx(opts, name, args, processOptions, processStdin, cb) {
opts.publish = opts.publish || function() {};

Expand Down

0 comments on commit 604cc31

Please sign in to comment.