-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HPCC4J-599 Halt all JUnits on init failure
- Updated init logic in BaseRemoteTest to automatically fail tests if init fails Signed-off-by: James McMullan [email protected]
- Loading branch information
Showing
3 changed files
with
85 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,12 +12,6 @@ jobs: | |
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
fetch-depth: 0 | ||
- name: Rebase | ||
run: | | ||
git config user.email '[email protected]' | ||
git config user.name 'hpccsystems development' | ||
git rebase origin/${{ github.event.pull_request.base.ref }} | ||
git log --pretty=one -n 15 | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v1 | ||
|
@@ -34,3 +28,7 @@ jobs: | |
|
||
- name: Build with Maven | ||
run: mvn -B package --file pom.xml | ||
|
||
# Expect a failure here, verifying that the test suite fails early on init issues | ||
- name: Test Suite Verification | ||
run: "! mvn test --activate-profiles jenkins-on-demand -Dhpccconn=https://bad_host:8010" |
38 changes: 38 additions & 0 deletions
38
wsclient/src/test/java/org/hpccsystems/ws/client/BaseRemoteInitTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/*############################################################################## | ||
HPCC SYSTEMS software Copyright (C) 2024 HPCC Systems®. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
############################################################################## */ | ||
|
||
package org.hpccsystems.ws.client; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
import org.junit.experimental.categories.Category; | ||
|
||
@Category(org.hpccsystems.commons.annotations.RemoteTests.class) | ||
public class BaseRemoteInitTest | ||
{ | ||
@Test | ||
public void initTest() throws Exception | ||
{ | ||
String exceptionMessage = ""; | ||
if (BaseRemoteTest.initializationException != null) | ||
{ | ||
exceptionMessage = BaseRemoteTest.initializationException.getMessage(); | ||
} | ||
|
||
Assert.assertTrue("Error initializing test suite: " + exceptionMessage, BaseRemoteTest.initializationException == null); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters