Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 19 additions & 11 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: PR CI Checks

on: [pull_request]
on:
pull_request:
push:
branches: [ "v3" ]

jobs:
check-commit-message:
Expand All @@ -15,14 +18,16 @@ jobs:
excludeDescription: "true"
checkAllCommitMessages: "true"
accessToken: ${{ secrets.PAT_ACTIONS }}
error: "One of your your commit messages is not matching the format with JIRA ID Ex: ( SDK-123 commit message )"
error: "One of your commit messages is not matching the format with JIRA ID Ex: ( SDK-123 commit message )"

Test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- uses: actions/setup-java@v1
with:
java-version: "1.8"
java-version: "11"

- name: create-json
id: create-json
Expand All @@ -34,18 +39,21 @@ jobs:
- name: create env
id: create-env
run: |
touch .env
echo SKYFLOW_CREDENTIALS=${{ secrets.SKYFLOW_CREDENTIALS }} >> .env
echo TEST_EXPIRED_TOKEN=${{ secrets.TEST_EXPIRED_TOKEN }} >> .env
echo TEST_REUSABLE_TOKEN=${{ secrets.TEST_REUSABLE_TOKEN }} >> .env
touch v3/.env
echo SKYFLOW_CREDENTIALS=${{ secrets.SKYFLOW_CREDENTIALS }} >> v3/.env
echo TEST_EXPIRED_TOKEN=${{ secrets.TEST_EXPIRED_TOKEN }} >> v3/.env
echo TEST_REUSABLE_TOKEN=${{ secrets.TEST_REUSABLE_TOKEN }} >> v3/.env

- name: Build & Run tests with Maven
run: mvn -B package -f pom.xml -Dmaven.javadoc.skip=true
run: mvn -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn clean test jacoco:report -pl v3 -am -Dmaven.javadoc.skip=true

- name: Codecov
uses: codecov/codecov-action@v2.1.0
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_REPO_UPLOAD_TOKEN }}
files: target/site/jacoco/jacoco.xml
files: v3/target/site/jacoco/jacoco.xml
flags: unittests

name: codecov-skyflow-java
verbose: true
fail_ci_if_error: true
verbose: true
8 changes: 1 addition & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit-version}</version>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -141,12 +141,6 @@
<version>2.0.9</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.13.2</version>
<scope>compile</scope>
</dependency>
</dependencies>

<build>
Expand Down
7 changes: 5 additions & 2 deletions v3/src/test/java/com/skyflow/VaultClientTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ public void testSetBearerTokenWithEnvCredentials() {
vaultClient.setBearerToken();

// Credentials at ENV level should be prioritised
Assert.assertEquals(credentials, getPrivateField(vaultClient, "finalCredentials"));
Assert.assertEquals(
credentials.getCredentialsString(),
((Credentials) getPrivateField(vaultClient, "finalCredentials")).getCredentialsString()
);

} catch (SkyflowException e) {
Assert.assertEquals(ErrorCode.INVALID_INPUT.getCode(), 400);
Expand Down Expand Up @@ -278,4 +281,4 @@ private Object getPrivateField(Object obj, String fieldName) throws Exception {
return field.get(obj);
}

}
}
4 changes: 2 additions & 2 deletions v3/src/test/java/com/skyflow/utils/UtilsTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import java.util.*;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertEquals;

public class UtilsTests {
private static final String INVALID_EXCEPTION_THROWN = "Should not have thrown any exception";
Expand Down Expand Up @@ -990,4 +990,4 @@ public void testHandleBatchExceptionWithApiClientApiExceptionCause() {
Assert.assertEquals(400, errors.get(0).getCode());
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@

import static org.junit.Assert.*;

import org.junit.runner.RunWith;
import org.powermock.core.classloader.annotations.PowerMockIgnore; // Import this
import org.powermock.modules.junit4.PowerMockRunner;

@RunWith(PowerMockRunner.class)
@PowerMockIgnore({"javax.management.*", "java.nio.*", "com.sun.*", "jdk.internal.reflect.*", "javax.crypto.*"})
public class VaultControllerTests {
private static final String ENV_PATH = "./.env";

Expand Down
Loading