Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fixing intermittent CI test failures #256

Closed
wants to merge 5 commits into from
Closed
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
42 changes: 21 additions & 21 deletions .github/actions/ci/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,27 @@ runs:
id: build
run: ./gradlew build jar

# - name: Run Unit Tests
# if: inputs.run_tests == 'true'
# shell: bash
# run: ./gradlew test
#
# - name: Build contract tests
# shell: bash
# run: make build-contract-tests
#
# - name: Perform Instrumented Tests
# uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 #2.30.1
# with:
# api-level: ${{ inputs.android_api_level }}
# target: google_apis
# emulator-boot-timeout: 900
# emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
# disable-animations: true
# script: |
# make start-contract-test-service
# make run-contract-tests
# ./gradlew connectedDebugAndroidTest
- name: Run Unit Tests
if: inputs.run_tests == 'true'
shell: bash
run: ./gradlew test

- name: Build contract tests
shell: bash
run: make build-contract-tests

- name: Perform Instrumented Tests
uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 #2.30.1
with:
api-level: ${{ inputs.android_api_level }}
target: google_apis
emulator-boot-timeout: 900
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: |
make start-contract-test-service
make run-contract-tests
./gradlew connectedDebugAndroidTest

- name: Build documentation
uses: ./.github/actions/build-docs
Original file line number Diff line number Diff line change
Expand Up @@ -257,21 +257,16 @@ public void testEventContainsAutoEnvAttributesWhenEnabled() throws Exception {
.diagnosticOptOut(true)
.serviceEndpoints(Components.serviceEndpoints()
.events(baseUrl.uri())
.streaming(baseUrl.uri())
.polling(baseUrl.uri())
)
.build();

// Don't wait as we are not set offline
try (LDClient ldClient = LDClient.init(application, ldConfig, ldContext, 0)){
ldClient.track("test-event");
ldClient.blockingFlush();

LDValue[] events = getEventsFromLastRequest(mockEventsServer, 2);
LDValue identifyEvent = events[0], customEvent = events[1];
assertIdentifyEvent(identifyEvent, ldContext);
assertTrue(customEvent.get("contextKeys").toString().contains("ld_application"));
assertTrue(customEvent.get("contextKeys").toString().contains("ld_device"));
LDValue[] events = getEventsFromLastRequest(mockEventsServer, 1);
LDValue identifyEvent = events[0];
assertTrue(identifyEvent.get("context").toString().contains("ld_application"));
assertTrue(identifyEvent.get("context").toString().contains("ld_device"));
}
}
}
Expand All @@ -289,21 +284,16 @@ public void testEventDoesNotContainAutoEnvAttributesWhenDisabled() throws Except
.diagnosticOptOut(true)
.serviceEndpoints(Components.serviceEndpoints()
.events(baseUrl.uri())
.streaming(baseUrl.uri())
.polling(baseUrl.uri())
)
.build();

// Don't wait as we are not set offline
try (LDClient ldClient = LDClient.init(application, ldConfig, ldContext, 0)){
ldClient.track("test-event");
ldClient.blockingFlush();

LDValue[] events = getEventsFromLastRequest(mockEventsServer, 2);
LDValue identifyEvent = events[0], customEvent = events[1];
assertIdentifyEvent(identifyEvent, ldContext);
assertFalse(customEvent.get("contextKeys").toString().contains("ld_application"));
assertFalse(customEvent.get("contextKeys").toString().contains("ld_device"));
LDValue[] events = getEventsFromLastRequest(mockEventsServer, 1);
LDValue identifyEvent = events[0];
assertFalse(identifyEvent.get("context").toString().contains("ld_application"));
assertFalse(identifyEvent.get("context").toString().contains("ld_device"));
}
}
}
Expand Down
Loading