Skip to content

Commit

Permalink
fix: do not launch unit tests in dockerfile for ARMv7 image (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
sralloza authored Jan 22, 2023
1 parent 43331e4 commit 7ab1c83
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 24 deletions.
34 changes: 13 additions & 21 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,8 @@ plugins {
id 'io.freefair.lombok' version '6.4.1'
}

test {
testLogging {
events 'passed', 'skipped', 'failed'

showExceptions true
exceptionFormat 'full'
showCauses true
showStackTraces true

showStandardStreams false
}
}

group 'es.sralloza'
version '0.3.3'
version '0.3.4'

repositories {
mavenCentral()
Expand Down Expand Up @@ -66,15 +53,20 @@ dependencies {
test {
useJUnitPlatform()
testLogging {
showExceptions = true
exceptionFormat = 'full'
showCauses = true
showStackTraces = true
showStandardStreams = false
events "passed", "skipped", "failed"

afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
println "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)"
}
}
showStandardStreams = true
}
testLogging {
afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
println "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)"
}
}
}
}

compileJava.options.encoding = 'UTF-8'
Expand Down
7 changes: 4 additions & 3 deletions delivery/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ COPY gradle/ /home/gradle/gradle/
COPY build.gradle settings.gradle gradlew /home/gradle/
COPY src/ /home/gradle/src/

# RUN ./gradlew build
# RUN ./gradlew test --scan
RUN ./gradlew clean test --console verbose
ARG TARGETARCH

# XXX: Skip tests for ARMv7. Tests with MockWebServer fail on shutdown with "java.io.IOException: Gave up waiting for queue to shut down" only on ARMv7.
RUN if [ "${TARGETARCH}" != "arm" ]; then ./gradlew clean test --console verbose; else echo "Skipping tests for ARMv7"; fi
RUN ./gradlew jar

FROM sralloza/openjdk:11-jre
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/bot/ChoreManagementBot.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ private void processMsg(MessageContext ctx) {
case UserMessages.UNSKIP:
silent.forceReply(BotMessages.ASK_FOR_WEEK_TO_UNSKIP, ctx.chatId());
break;
case UserMessages.TRANSFER:
helper.sendMessage(BotMessages.NOT_IMPLEMENTED, chatId, true);
break;
default:
helper.sendMessage(BotMessages.UNDEFINED_COMMAND, chatId, true);
break;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/constants/BotMessages.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public class BotMessages {
" información al administrador para resolver el problema\\.";
public static final String NO_TICKETS_FOUND = "No se han encontrado tickets";

public static final String NOT_IMPLEMENTED = "Comando no implementado";

public static final String WEEK_SKIPPED = "Semana saltada: %s";
public static final String WEEK_UNSKIPPED = "Semana restaurada: %s";

Expand Down

0 comments on commit 7ab1c83

Please sign in to comment.