Skip to content

Commit

Permalink
Merge branch 'master' into fix-integration-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gijskant committed Sep 27, 2016
2 parents f95afbc + d0f2c5c commit 58a48ff
Show file tree
Hide file tree
Showing 73 changed files with 1,251 additions and 349 deletions.
50 changes: 40 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,61 @@
language: groovy
sudo: false

jdk:
- oraclejdk8
- oraclejdk8
php:
- 5.6
env:
- TERM=dumb; DIR=transmart-core-db-tests; PREPARE=assemble; TEST=check
- TERM=dumb; DIR=transmart-data; PREINSTALL="createVars setupPostgres"; INSTALL=downloadTransmartETL; TEST=dataloadingTest

addons:
postgres: 9.4

before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -rf $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $HOME/.m2/
- $HOME/.gradle/caches
- $HOME/.gradle/wrapper
- $HOME/.m2
- $HOME/pg

before_install:
- gradle --version
- sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 3375DA21
- echo deb http://apt.thehyve.net/internal/ trusty main | sudo tee /etc/apt/sources.list.d/hyve_internal.list
- sudo apt-key adv --keyserver keyserver.ubuntu.com --recv E5267A6C
- echo deb http://ppa.launchpad.net/ondrej/php5/ubuntu precise main | sudo tee /etc/apt/sources.list.d/ondrej_php5.list
- sudo apt-get -qq update
- apt-cache search php
- sudo apt-get install -y tk-dev php5-cli php5-json
- php --version
- echo $DIR; cd $DIR
- PWD=`pwd`
- echo $PWD
- ([ -z "$PREINSTALL" ] && echo "Skipping preinstall.") || (echo $PREINSTALL; sudo -i -- sh -c "cd $PWD; gradle $PREINSTALL")
- cd -

install:
- echo $DIR; cd $DIR
- ([ -z "$INSTALL" ] && echo "Skipping install.") || (echo $INSTALL; gradle $INSTALL)
- cd -

before_script:
- cd transmart-core-db-tests
- ./gradlew --console=plain assemble
- echo $DIR; cd $DIR
- ([ -z "$PREPARE" ] && echo "Skipping prepare.") || (echo $PREPARE; gradle $PREPARE)
- cd -

script:
- cd transmart-core-db-tests
- ./gradlew --console=plain --stacktrace check
- echo $DIR; cd $DIR
- ([ -z "$TEST" ] && echo "Skipping test.") || (echo $TEST; gradle --stacktrace $TEST)
- cd -

notifications:
hipchat:
rooms:
secure: "rNPPKSL1o8R71YcD7T+jDFTFfSFoXO/YKCubqwP5TXFL+OtqEwZOrkpKSpyN+Ap6Uxk85TBgat8Bur/WkTWXcq6HruyhfKkKea96ZVVSWjZWhKHqqTLvMeABb1uh6JxpXAc/5Cm3K5/yTHBFFiFSyOemuEl88bqeqJjDSzIxvOLrdLhnYWVlo3SJcUwAab0IKab8MpbZUEa6eFB5+MmCQfwjDZBr9Qn7UGfQWQdEp801sHGzU2i58uwF7+RVYhUyZtT9428FmPhxAS2EgW663JpzNQYpVCws02UW8aCgu2SCWWtUKwk3dy/6hSc5UoxWIIKaIpPbre+SA5JYeB7RwIad7N6/eDHdb/ByN1lOP6/pAEzPSnajxJrU/AnohhIwgcPaZ3aHbrqq8RrGPy1sNwFTKvFzBkVu5aWKR7JMgKuBq0LXv4iq1qBJw1s+xK4CHNoOAESZG2a0wo/cmzK+C2OzKdTnjN25RoHwXBOS7AzJtdtqpU8PaESZ0X1BxT19nD3RALiCfS/054SU3mfswhVAdo6rVhHDgGNxqRflgZIVmDsYjBRZ4TR4jDnUhc+s9ILo1eI/imq7tQZ6rFeQrydCu4p2U4LrFAWu7E0QwTbsfnSs5KN7Fah1xhS+6xttOuqbAmPQXEeLKSkk6B9Q7G/R0VHAKdaNkLweA0ZzATM="
on_success: change
on_failure: always
on_failure: change

3 changes: 2 additions & 1 deletion Rmodules/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ dependencies {
testCompile 'org.gmock:gmock:0.8.3'
testCompile 'org.hamcrest:hamcrest-library:1.3'
testCompile 'org.hamcrest:hamcrest-core:1.3'
compile 'quartz:quartz:1.5.1-atlassian-2'

compile 'org.grails.plugins:quartz:2.0.1'
// https://mvnrepository.com/artifact/org.apache.commons/commons-io
compile group: 'org.apache.commons', name: 'commons-io', version: '1.3.2'
// https://mvnrepository.com/artifact/org.xhtmlrenderer/flying-saucer-pdf
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class DataAssociationController {

// list of required css
def styles = [
servletContext.contextPath+pluginContextPath+'/css/rmodules.css',
servletContext.contextPath+pluginContextPath+'/css/jquery.qtip.min.css']
servletContext.contextPath+pluginContextPath+'/assets/rmodules.css',
servletContext.contextPath+pluginContextPath+'/assets/jquery.qtip.min.css']
//TODO: requires images: servletContext.contextPath+pluginContextPath+'/css/jquery-ui-1.10.3.custom.css']

JSONObject result = new JSONObject()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@ package com.recomdata.transmart.data.association
import com.google.common.collect.Maps
import grails.converters.JSON
import grails.core.GrailsApplication
import grails.util.Holders
import jobs.*
import jobs.misc.AnalysisConstraints
import jobs.misc.AnalysisQuartzJobAdapter
import org.grails.web.converters.exceptions.ConverterException
import org.grails.web.json.JSONElement
import org.quartz.JobBuilder
import org.quartz.JobDataMap
import org.quartz.JobDetail
import org.quartz.SimpleTrigger
import org.quartz.TriggerBuilder
import org.quartz.core.QuartzScheduler
import org.transmartproject.core.exceptions.InvalidArgumentsException

import static jobs.misc.AnalysisQuartzJobAdapter.*
Expand Down Expand Up @@ -55,6 +57,7 @@ class RModulesController {
def RModulesService
GrailsApplication grailsApplication
def jobResultsService
QuartzScheduler quartzScheduler

/**
* Method called that will cancel a running job
Expand Down Expand Up @@ -169,9 +172,14 @@ class RModulesController {
params.put(PARAM_USER_PARAMETERS, userParams)
params.put(PARAM_USER_IN_CONTEXT, currentUserBean.targetSource.target)

JobDetail jobDetail = new JobDetail(params.jobName, params.jobType, AnalysisQuartzJobAdapter)
jobDetail.jobDataMap = new JobDataMap(params)
SimpleTrigger trigger = new SimpleTrigger("triggerNow ${Calendar.instance.time.time}", 'RModules')
JobDetail jobDetail = JobBuilder.newJob(AnalysisQuartzJobAdapter)
.withIdentity(params.jobName, params.jobType)
.setJobData(params)
.build()
SimpleTrigger trigger = TriggerBuilder.newTrigger()
.startNow()
.withIdentity('RModules')
.build()
quartzScheduler.scheduleJob(jobDetail, trigger)
}

Expand Down Expand Up @@ -226,7 +234,4 @@ class RModulesController {
constraints
}

private static def getQuartzScheduler() {
Holders.grailsApplication.mainContext.quartzScheduler
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package rmodules

import org.transmartproject.core.users.User

class AnalysisFilesInterceptor {

def accessLogService
User currentUserBean

AnalysisFilesInterceptor() {
match(controller: 'analysisFiles', action:'download')
}

boolean before() { true }

boolean after() {
if (params.path.toLowerCase().endsWith('.zip')) {
def ip = request.getHeader('X-FORWARDED-FOR') ?: request.remoteAddr
accessLogService.report(currentUserBean, 'Raw R Data Export',
eventMessage: "User (IP: ${ip}) downloaded ${params.path} for ${params.analysisName}",
requestURL: "${request.forwardURI}${request.queryString ? '?' + request.queryString : ''}")
}
true
}

void afterView() {
// no-op
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package rdc.rmodules
package rmodules

class UrlMappings {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@
package com.recomdata.transmart.data.association

import com.recomdata.transmart.data.association.asynchronous.RModulesJobService
import grails.transaction.Transactional
import org.grails.web.json.JSONObject
import org.quartz.JobBuilder
import org.quartz.JobDataMap
import org.quartz.JobDetail
import org.quartz.SimpleTrigger
import org.quartz.TriggerBuilder
import org.quartz.core.QuartzScheduler

@Transactional
class RModulesService {

static transactional = true
static scope = 'request'

static STATUS_LIST = [
Expand All @@ -39,8 +41,7 @@ class RModulesService {
/**
* quartzScheduler is available from the Quartz grails-plugin
*/
def quartzScheduler

QuartzScheduler quartzScheduler
def jobResultsService
def asyncJobService
def grailsApplication
Expand Down Expand Up @@ -211,16 +212,21 @@ class RModulesService {
if (jobResultsService[params.jobName]["Status"] == "Cancelled") {return}

//com.recomdata.transmart.plugin.PluginJobExecutionService should be implemented by all Plugins
def jobDetail = new JobDetail(params.jobName, params.jobType, RModulesJobService.class)
def jobDetail = JobBuilder.newJob(RModulesJobService.class)
.withIdentity(params.jobName, params.jobType)
.build()
jobDetail.setJobDataMap(jobDataMap)

if (asyncJobService.updateStatus(params.jobName, jobStatusList[2])) {
return
}
def trigger = new SimpleTrigger("triggerNow"+Calendar.instance.time.time, 'RModules')
def trigger = TriggerBuilder.newTrigger()
.startNow()
.withIdentity('RModules')
.build()
quartzScheduler.scheduleJob(jobDetail, trigger)
}

// method for non-R jobs
def prepareDataForExport(userName, params) {
loadJobDataMap(userName, params);
Expand Down
4 changes: 2 additions & 2 deletions Rmodules/grails-app/views/plugin/AcghFrequencyPlot.gsp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%{--include js lib for heatmap dynamically--}%
<r:require modules="freq_plot"/>
<r:layoutResources disposition="defer"/>
%{--<r:require modules="freq_plot"/>--}%
%{--<r:layoutResources disposition="defer"/>--}%

%{--Input Container--}%
<div id="freq_plot_container" class="analysis_container"></div>
Expand Down
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Tue Sep 27 10:49:32 CEST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-bin.zip

0 comments on commit 58a48ff

Please sign in to comment.