Skip to content

Commit 07b6ac8

Browse files
committed
fix: Skip E2E tests in build
1 parent 0d3032d commit 07b6ac8

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
- name: Run tests
3939
env:
4040
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
41+
E2E: true
4142
run: |
4243
./gradlew test
4344

.github/workflows/sdk_publish.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ permissions:
1212
paths:
1313
- .speakeasy/gen.lock
1414
workflow_dispatch: {}
15-
env:
16-
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
1715
jobs:
1816
publish:
1917
uses: speakeasy-api/sdk-generation-action/.github/workflows/sdk-publish.yaml@v15

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -716,8 +716,8 @@ public class Application {
716716
To run the tests, install Java, ensure to download the `private_key.pem` for the test environment, and run the following.
717717

718718
```sh
719-
./gradlew test --rerun-tasks
720-
```
719+
E2E=true ./gradlew clean test
720+
```
721721

722722
## Maturity
723723

src/test/java/com/gr4vy/sdk/CheckoutSessionsTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package com.gr4vy.sdk;
22

33
import org.junit.jupiter.api.Test;
4+
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
5+
46
import com.gr4vy.sdk.models.components.CardPaymentMethodCreate;
57
import com.gr4vy.sdk.models.components.CheckoutSession;
68
import com.gr4vy.sdk.models.components.CheckoutSessionCreate;
@@ -33,6 +35,7 @@ void prepareGr4vyClient() throws Exception {
3335
}
3436

3537
@Test
38+
@EnabledIfEnvironmentVariable(named = "E2E", matches = "true")
3639
void testProcessPaymentWithCheckoutSession() throws Exception {
3740
// Create a checkout session
3841
CreateCheckoutSessionResponse checkoutSessionResponse = gr4vyClient.checkoutSessions().create()
@@ -85,6 +88,7 @@ void testProcessPaymentWithCheckoutSession() throws Exception {
8588
}
8689

8790
@Test
91+
@EnabledIfEnvironmentVariable(named = "E2E", matches = "true")
8892
void testHandleErrorOnMissingCardData() throws Exception {
8993
// Create a checkout session
9094
CreateCheckoutSessionResponse checkoutSessionResponse = gr4vyClient.checkoutSessions().create()
@@ -113,6 +117,7 @@ void testHandleErrorOnMissingCardData() throws Exception {
113117
}
114118

115119
@Test
120+
@EnabledIfEnvironmentVariable(named = "E2E", matches = "true")
116121
void testHandleStoredPaymentMethod() throws Exception {
117122
// Create a card payment method
118123
CreatePaymentMethodResponse createPaymentMethodResponse = gr4vyClient.paymentMethods().create()

0 commit comments

Comments
 (0)