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

Commit 604cc31

Browse files
committed
- removed groovyserv reference
- code cleanup
1 parent 9df0faf commit 604cc31

File tree

4 files changed

+24
-20
lines changed

4 files changed

+24
-20
lines changed

docker/java.docker

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ RUN mv groovy-2.4.10 groovy
3131
ENV GROOVY_HOME /usr/local/groovy/
3232
ENV PATH /usr/local/groovy/bin:${PATH}
3333

34-
# Setup GroovyServ
35-
RUN mv groovyserv-1.1.0 groovyserv
36-
ENV PATH /usr/local/groovyserv/bin:${PATH}
37-
3834
# Install zip utils
3935
RUN apt-get install -y zip unzip --no-install-recommends
4036

documentation/environments/java.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ Within the setup code you can load any of these packages using reference config
4242

4343
**Setup Example:**
4444
```java
45-
// @config reference guava
46-
// @config reference commons-lang3
45+
// @config: reference guava
46+
// @config: reference commons-lang3
4747
```
4848

4949

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

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

6767
# Timeout
6868

lib/runners/java.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ module.exports.run = function run(opts, cb) {
2222
buildAndTest(runCode);
2323
},
2424
testIntegration: function (runCode, fail) {
25-
2625
fs.emptydirSync(`${opts.dir}/src`);
26+
2727
const fixtures = [];
2828

2929
if (opts.solution) {
@@ -63,7 +63,6 @@ module.exports.run = function run(opts, cb) {
6363
buildAndTest(runCode);
6464
},
6565
transformBuffer: function (buffer) {
66-
opts.publish('processing output');
6766
var stdout = "", stderr = "", buildLines = [];
6867

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

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

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

166+
// auto include data packages if services are configured
167167
if (opts.services) {
168168
if (opts.services.indexOf('mongodb') >= 0) {
169169
opts.references.push('spring-boot-starter-data-mongodb');

lib/shovel.js

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,22 @@ function cleanup() {
187187
spawnSync('bash', ['/runner/lib/cleanup.sh']);
188188
}
189189

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

0 commit comments

Comments
 (0)