Skip to content

Commit

Permalink
fix unit test action (sofastack#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzdx authored Jun 2, 2022
1 parent 3e20e15 commit a3b818d
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 12 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: ut
- name: Integration Test
run: mvn compile -B
&& sh ./tools/check_format.sh
&& mvn clean test -DisSkipUnitTest=true "-Dtest.logging.level=ERROR"
&& mvn clean test -DisSkipUnitTest=true "-Dtest.logging.level=ERROR"
- name: Publish Test Report
if: ${{ always() }}
uses: ScaCap/action-surefire-report@v1
with:
fail_on_test_failures: true
skip_publishing: true

11 changes: 8 additions & 3 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,15 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: ut
- name: Unit Testt
run: mvn compile -B
&& sh ./tools/check_format.sh
&& mvn clean test -DisSkipIntegrationTest=true "-Dtest.logging.level=ERROR"
&& mvn clean test -DisSkipIntegrationTest=true "-Dtest.logging.level=ERROR" --fail-at-end --batch-mode
- name: Publish Test Report
if: ${{ always() }}
uses: ScaCap/action-surefire-report@v1
with:
fail_on_test_failures: true
skip_publishing: true
- name: Codecov
uses: codecov/codecov-action@v1
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ public class DirectServerManager implements ServerManager {

public DirectServerManager(RegistryClientConfig config) {
this.serverNodes = new ArrayList<ServerNode>();
int port = config.getRegistryEndpointPort();
if (port == 0) {
port = 9600;
}
this.serverNodes.add(
ServerNodeParser.parse(
String.format(
"%s:%s", config.getRegistryEndpoint(), config.getRegistryEndpointPort())));
ServerNodeParser.parse(String.format("%s:%s", config.getRegistryEndpoint(), port)));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public void initServerList() {

// when
when(config.getRegistryEndpoint()).thenReturn("127.0.0.1");
when(config.getRegistryEndpointPort()).thenReturn(9600);

// then
ServerManager serverManager = new DirectServerManager(config);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
* @version $Id: BoltServerTest.java, v 0.1 2018-05-14 19:34 shangyu.wh Exp $
*/
public class BoltServerTest {
private static URL url = new URL("0.0.0.0", 12345);
private static BoltServer server = new BoltServer(url, Collections.emptyList());
private static URL url = new URL("127.0.0.1", 12345);
private static URL listenURL = new URL("0.0.0.0", 12345);
private static BoltServer server = new BoltServer(listenURL, Collections.emptyList());

@BeforeClass
public static void before() {
Expand Down

0 comments on commit a3b818d

Please sign in to comment.