Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
basiliskus committed Nov 26, 2024
1 parent 8805104 commit f4df497
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/automated-staging-test-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ jobs:
- name: Run automated tests
env:
AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AUTOMATED_TEST_AZURE_STORAGE_CONNECTION_STRING }}
ORG_GRADLE_CONSOLE: plain
run: ./gradlew rs-e2e:clean rs-e2e:automatedTest --quiet
run: ./gradlew rs-e2e:clean rs-e2e:automatedTest

# - name: Send slack notification on test failure
# if: failure()
Expand Down
6 changes: 1 addition & 5 deletions rs-e2e/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@ task automatedTest(type: Test) {
include '**/AutomatedTest.*'

testLogging {
// events 'failed'
exceptionFormat 'full'
// showExceptions true
// showCauses true
showStackTraces true
// showStandardStreams true
exceptionFormat 'full'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class AutomatedTest extends Specification {
AssertionRuleEngine engine
HapiHL7FileMatcher fileMatcher
Logger mockLogger = Mock(Logger)
List<String> loggedWarnings = []
List<String> loggedErrorsAndWarnings = []

def setup() {
engine = AssertionRuleEngine.getInstance()
Expand All @@ -37,7 +37,10 @@ class AutomatedTest extends Specification {
TestApplicationContext.injectRegisteredImplementations()

mockLogger.logWarning(_ as String, _ as Object) >> { String msg, Object args ->
loggedWarnings << msg
loggedErrorsAndWarnings << msg
}
mockLogger.logError(_ as String, _ as Exception) >> { String msg, Exception e ->
loggedErrorsAndWarnings << msg
}

FileFetcher azureFileFetcher = AzureBlobFileFetcher.getInstance()
Expand Down Expand Up @@ -70,9 +73,8 @@ class AutomatedTest extends Specification {

then:
rulesToEvaluate.collect { it.name }.isEmpty() //Check whether all the rules in the assertions file have been run
0 * mockLogger.logError(_ as String, _ as Exception)
if (!loggedWarnings.isEmpty()) {
throw new AssertionError("Unexpected warnings were logged:\n- ${loggedWarnings.join('\n- ')}")
if (!loggedErrorsAndWarnings.isEmpty()) {
throw new AssertionError("Unexpected errors and/or warnings were logged:\n- ${loggedErrorsAndWarnings.join('\n- ')}")
}
}
}

0 comments on commit f4df497

Please sign in to comment.