Skip to content

Commit

Permalink
build: move tests to djobi-tests project
Browse files Browse the repository at this point in the history
  • Loading branch information
ebuildy committed Jan 19, 2022
1 parent be5031b commit 2d2bb2a
Show file tree
Hide file tree
Showing 22 changed files with 103 additions and 31 deletions.
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ allprojects {
}

subprojects {
apply plugin: 'signing'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'nebula.release'

Expand Down
2 changes: 1 addition & 1 deletion djobi-cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies {
/**
* Need core tests code
*/
testImplementation(testFixtures(project(":djobi-core")))
testImplementation(project(":djobi-tests"))

/**
* To run Djobi via Idea.
Expand Down
27 changes: 6 additions & 21 deletions djobi-core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
id 'java-library'
id "java-test-fixtures"
id "idea"
id 'maven-publish'
id 'signing'
Expand All @@ -20,9 +19,6 @@ configurations {
// Common libs
djobiCore

//testFixturesCompile.extendsFrom djobiCore
//testFixturesCompile.extendsFrom spark

djobiRelease

djobiRelease.extendsFrom djobiCore
Expand All @@ -32,10 +28,6 @@ configurations {
api.extendsFrom sparkAssemblyProvided
api.extendsFrom spark
api.extendsFrom sparkAWS
/*
testCompile.extendsFrom testFixturesCompile
testFixturesCompile.extendsFrom sparkAssemblyProvided
testFixturesCompile.extendsFrom sparkAWS*/
}

dependencies {
Expand Down Expand Up @@ -91,25 +83,18 @@ dependencies {
[group: 'org.apache.spark', name: 'spark-sql_' + scalaVersion, version: sparkVersion]
)

testFixturesApi(
[group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.25'],
[group: 'com.google.code.gson', name: 'gson', version: '2.8.5'],
[group: 'com.github.stefanbirkner', name: 'system-lambda', version: '1.2.0']
)

testFixturesImplementation(
[group: 'com.squareup.okhttp3', name: 'mockwebserver3-junit5', version: '5.0.0-alpha.2'],
[group: 'com.google.inject', name: 'guice', version: '5.0.1']
)

configurations.all {
exclude group: 'junit', module: 'junit'
exclude group: 'org.apache.hadoop', module: 'hadoop-yarn-client'
exclude group: 'org.apache.hadoop', module: 'hadoop-yarn-api'
exclude group: 'org.apache.hadoop', module: 'hadoop-yarn-common'
}

testImplementation(project(":djobi-tests"))
}

javadoc.options.addStringOption('Xdoclint:none', '-quiet')

signing {
sign configurations.archives
}
Expand Down Expand Up @@ -146,8 +131,8 @@ publishing {

repositories {
maven {
name = "OSSRH"
url = "https://s01.oss.sonatype.org/"
name = "ossrh"
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"

credentials {
username = System.getenv("MAVEN_USERNAME")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package io.datatok.djobi.engine;

import com.github.mustachejava.MustacheException;
import io.datatok.djobi.engine.Job;
import io.datatok.djobi.engine.Pipeline;
import io.datatok.djobi.engine.PipelineExecutionRequest;
import io.datatok.djobi.engine.parameters.DateParameter;
import io.datatok.djobi.loaders.yaml.YAMLPipelineLoader;
import io.datatok.djobi.test.MyTestRunner;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import io.datatok.djobi.test.HttpNumbersResponse;
import io.datatok.djobi.test.MyTestRunner;
import io.datatok.djobi.test.mocks.HttpMock;
import io.datatok.djobi.utils.MyMapUtils;
import io.datatok.djobi.utils.http.Http;
import io.datatok.djobi.utils.http.HttpRequest;
import org.junit.jupiter.api.AfterAll;
Expand Down
2 changes: 1 addition & 1 deletion djobi-elasticsearch/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies {
compileOnly project(path: ':djobi-core', configuration: "spark")
compileOnly project(path: ':djobi-core', configuration: "djobiCore")

testImplementation(testFixtures(project(":djobi-core")))
testImplementation(project(":djobi-tests"))

es7(group: 'org.elasticsearch', name: 'elasticsearch-spark-30_' + scalaVersion, version:'7.16.2') {
exclude group: "org.scala-lang"
Expand Down
2 changes: 1 addition & 1 deletion djobi-filter-user_agent/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies {
compileOnly project(':djobi-core')
compileOnly project(path: ':djobi-core', configuration: 'spark')
compileOnly project(path: ':djobi-core', configuration: 'djobiCore')
testImplementation(testFixtures(project(':djobi-core')))
testImplementation(project(':djobi-tests'))

compileOnly(group: 'eu.bitwalker', name: 'UserAgentUtils', version: '1.21')

Expand Down
2 changes: 1 addition & 1 deletion djobi-kafka/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dependencies {
compileOnly project(path: ':djobi-core', configuration: "spark")
compileOnly project(path: ':djobi-core', configuration: "djobiCore")

testImplementation(testFixtures(project(":djobi-core")))
testImplementation(project(":djobi-tests"))

kafka1(group: 'org.apache.kafka', name: 'kafka-clients', version:'1.1.1') {
exclude group: "org.xerial.snappy"
Expand Down
90 changes: 90 additions & 0 deletions djobi-tests/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
}

group 'io.datatok'

repositories {
mavenCentral()
}

dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.2'

api(
[group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.25'],
[group: 'com.github.stefanbirkner', name: 'system-lambda', version: '1.2.0']
)

// https://mvnrepository.com/artifact/org.json/json
implementation 'org.json:json:20211205'

compileOnly project(':djobi-core')

compileOnly(
[group: 'com.squareup.okhttp3', name: 'mockwebserver3-junit5', version: '5.0.0-alpha.2'],
[group: 'com.google.inject', name: 'guice', version: '5.0.1'],
)
}

test {
useJUnitPlatform()
}

signing {
sign configurations.archives
}

publishing {
publications {
mavenJava(MavenPublication) {
groupId = 'io.datatok.djobi'
artifactId = 'djobi-tests'

from components.java

pom {
name = 'djobi-tests'
description = 'Djobi tests'
url = 'https://github.com/datatok/djobi'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'ebuildy'
name = 'Thomas Decaux'
email = '[email protected]'
}
}
}
}
}

repositories {
maven {
name = "ossrh"
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"

credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}

maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/datatok/djobi"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
4 changes: 3 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ include(":djobi-core")
include(":djobi-elasticsearch")
include(":djobi-kafka")
include(":djobi-filter-user_agent")
include(":djobi-cli")
include(":djobi-cli")
include(":djobi-tests")

0 comments on commit 2d2bb2a

Please sign in to comment.