Skip to content

Commit 7e4b3b6

Browse files
chore: update E2E tests sample (#77)
1 parent 0b7ff37 commit 7e4b3b6

3 files changed

Lines changed: 37 additions & 17 deletions

File tree

.github/actions/test-statgpt-sdmx-proxy/action.yml renamed to .github/actions/test-core/action.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: test-statgpt-sdmx-proxy
2-
description: Run statgpt-sdmx-proxy E2E tests against a deployed review environment
2+
description: Run statgpt-sdmx-proxy E2E tests from this repo against the review DIAL Core URL
33
inputs:
44
environment-url:
5-
description: Application URL of the environment, e.g. `https://chat-statgpt-sdmx-proxy-pr-1.example.com`
5+
description: Application URL of the environment, e.g. `https://core-statgpt-sdmx-proxy-pr-1.example.com`
66
required: true
77
test-repository:
88
description: GitHub repository with E2E test sources
@@ -47,8 +47,7 @@ runs:
4747
working-directory: ${{ inputs.working-directory }}
4848
env:
4949
E2E_HOST: ${{ inputs.environment-url }}
50-
GPR_USERNAME: ${{ env.GPR_USERNAME }}
51-
GPR_PASSWORD: ${{ env.GPR_PASSWORD }}
50+
E2E_PASSWORD: ${{ env.E2E_PASSWORD }}
5251
run: |
5352
echo "URL to run e2e tests against: ${E2E_HOST}"
5453
./gradlew ${{ inputs.gradle-task }} --tests "${{ inputs.test-filter }}"

.github/workflows/slash-command-dispatch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
"static_args": [
2626
"application=${{ github.event.repository.name }}",
2727
"environment=statgpt-review",
28-
"test-applications=${{ github.event.repository.name }}:${{ github.repository }}"
28+
"test-applications=core:${{ github.repository }}"
2929
]
3030
}
3131
]

sdmx-proxy-e2e/src/test/java/com/epam/sdmxproxy/e2e/tests/review/ReviewEnvironmentPlaceholderE2ETest.java

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,25 @@
99
import org.junit.jupiter.api.Test;
1010
import org.junit.jupiter.api.TestInstance;
1111

12+
import java.util.LinkedHashMap;
13+
import java.util.Map;
14+
1215
import static org.assertj.core.api.Assertions.assertThat;
1316

1417
/**
15-
* Smoke test for the review deploy pipeline. The review workflow currently supplies
16-
* the ai-dial-chat base URL via {@code E2E_HOST}, not the sdmx-proxy service URL.
18+
* Review deploy smoke: DIAL Core fronts SDMX routes; {@code E2E_HOST} is the Core origin
19+
* (e.g. {@code https://core-statgpt-sdmx-proxy-pr-124.example.com}).
20+
* <p>
21+
* DIAL {@code Api-Key} is read from {@code E2E_PASSWORD} (same secret ai-dial-ci passes for E2E).
1722
*/
1823
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
1924
@DisplayName("Review environment placeholder E2E")
2025
@Tag("e2e")
2126
@Tag("review")
2227
class ReviewEnvironmentPlaceholderE2ETest {
2328

24-
private static final String HEALTH_ENDPOINT = "/api/health";
25-
private static final String EXPECTED_HEALTH_RESPONSE = "Healthy";
29+
private static final String DATA_PATH =
30+
"/statgpt/sdmx-proxy/api/v0/sdmx/3.0/data/dataflow/BIS/WS_EER/1.0/*.N.B.US";
2631

2732
private RestClient restClient;
2833

@@ -32,16 +37,32 @@ void setUp() {
3237
}
3338

3439
@Test
35-
@DisplayName("Review chat health endpoint is reachable")
36-
void reviewChatHealthEndpointIsReachable() {
37-
Response response = restClient.getResponse(HEALTH_ENDPOINT);
40+
@DisplayName("BIS WS_EER data query via Core returns HTTP 200")
41+
void bisWsEerDataQueryViaCoreReturnsOk() {
42+
String apiKey = System.getenv("E2E_PASSWORD");
43+
assertThat(apiKey)
44+
.as("E2E_PASSWORD must be set to the DIAL API key (sent as Api-Key header)")
45+
.isNotBlank();
46+
47+
Map<String, String> headers = Map.of(
48+
"Api-Key", apiKey,
49+
"Content-Type", "application/json");
50+
51+
Map<String, Object> queryParams = new LinkedHashMap<>();
52+
queryParams.put("c[TIME_PERIOD]", "ge:2024-05-01+le:2026-05-31");
53+
queryParams.put("includeHistory", "false");
54+
queryParams.put("limit", "1000");
55+
queryParams.put("attributes", "all");
56+
queryParams.put("dimensionAtObservation", "TIME_PERIOD");
57+
58+
Response response = restClient.get(DATA_PATH)
59+
.headers(headers)
60+
.queryParams(queryParams)
61+
.when()
62+
.get();
3863

3964
assertThat(response.getStatusCode())
40-
.as("Chat health endpoint should return HTTP 200")
65+
.as("SDMX data endpoint should return HTTP 200")
4166
.isEqualTo(200);
42-
43-
assertThat(response.getBody().asString())
44-
.as("Chat health endpoint should return Healthy")
45-
.contains(EXPECTED_HEALTH_RESPONSE);
4667
}
4768
}

0 commit comments

Comments
 (0)