Skip to content

Commit

Permalink
Fix Azure test that verifies node can start and run in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-j-h committed May 10, 2024
1 parent 30f57f5 commit 6871c2a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ jobs:
path: /home/runner/work/tessera/tessera/encryption/encryption-kalium/build/distributions/
- name: Execute gradle integration tests
run: |
./gradlew :tests:acceptance-test:clean :tests:acceptance-test:test --fail-fast -PexcludeTests="RunHashicorpIT,AwsKeyVaultIT,RecoverIT,RunAzureIT,RestSuiteHttpH2RemoteEnclaveEncTypeEC,CucumberTestSuite" --info
./gradlew :tests:acceptance-test:clean :tests:acceptance-test:test --fail-fast -PexcludeTests="RunHashicorpIT,AwsKeyVaultIT,RecoverIT,RunAzureIT,AzureKeyVaultIT,RestSuiteHttpH2RemoteEnclaveEncTypeEC,CucumberTestSuite" --info
- name: Upload Junit reports
uses: actions/upload-artifact@v2
if: always()
Expand Down Expand Up @@ -311,9 +311,12 @@ jobs:
- name: Run AWS tests
run: |
./gradlew :tests:acceptance-test:test --tests AwsKeyVaultIT --info
- name: Run azure tests
- name: Run azure tests (node starts)
run: |
./gradlew :tests:acceptance-test:test --tests RunAzureIT --info
./gradlew :tests:acceptance-test:test --tests AzureKeyVaultIT --info
# - name: Run azure tests (cucumber)
# run: |
# ./gradlew :tests:acceptance-test:test --tests RunAzureIT --info
- name: Run hashicorp tests
run: |
wget https://releases.hashicorp.com/vault/1.2.2/vault_1.2.2_linux_amd64.zip -O /tmp/vault_1.2.2_linux_amd64.zip
Expand Down
2 changes: 2 additions & 0 deletions tests/acceptance-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ test {
"**/P2pTestSuite.class",
"**/AwsKeyVaultIT.class",
"**/RunHashicorpIT.class",
// "**/RunAzureIT.class",
"**/AzureKeyVaultIT.class",
"**/ThirdPartyIT.class",
"**/CucumberTestSuite.class",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class AzureKeyVaultHttpHandler implements HttpHandler {
private AtomicInteger counter = new AtomicInteger(0);

private final String publicKey = "BULeR8JyUWhiuuCMU/HLA0Q5pzkYT+cHII3ZKBey3Bo=";
private final String privateKey = "Wl+xSyXVuuqzpvznOS7dOobhcn4C5auxkFRi7yLtgtA=";

private final String keyVaultUrl;

Expand Down Expand Up @@ -52,8 +53,18 @@ public void handle(HttpExchange exchange) throws IOException {
LOGGER.info("response send {}", new String(response));

exchange.close();
} else {
} else if (exchange.getRequestURI().toString().startsWith("/secrets/Key/")) {
JsonObject jsonObject = Json.createObjectBuilder().add("value", privateKey).build();

byte[] response = jsonObject.toString().getBytes();
exchange.sendResponseHeaders(200, response.length);
exchange.getResponseBody().write(response);

LOGGER.info("response send {}", new String(response));

exchange.close();
} else {
LOGGER.info("response send empty");
exchange.sendResponseHeaders(200, 0);
exchange.close();
}
Expand Down

0 comments on commit 6871c2a

Please sign in to comment.