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

Add optional pageType parameter to ParselyMetadata class in Android SDK #102

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
261 commits
Select commit Hold shift + click to select a range
4510d38
tests: heartbeat event build test
wzieba Oct 18, 2023
ac43fe4
tests: videostart event build test
wzieba Oct 18, 2023
5870256
tests: vheartbeat event build test
wzieba Oct 18, 2023
89d0666
refactor: extract shared pixel asserstions
wzieba Oct 18, 2023
df80cfa
tests: add test for null extraData case
wzieba Oct 18, 2023
ebeb7b8
tests: add test for not null extraData case
wzieba Oct 18, 2023
0437b89
tests: add test for null metadata case
wzieba Oct 18, 2023
ca8f2fb
tests: add test for not null metadata case
wzieba Oct 18, 2023
99db496
tools: disable Codecov Github annotations
wzieba Oct 18, 2023
1f6d084
style: remove unnecessary `this` qualifier
wzieba Oct 18, 2023
047e6a3
style: add empty line at the end of test
wzieba Oct 18, 2023
f10f31a
refactor: remove unnecessary if check
wzieba Oct 19, 2023
1c11ef7
refactor: pass instance of tracker to APIConnection
wzieba Oct 19, 2023
4f7d833
fix: make `ParselyAPIConnection` package-private
wzieba Oct 19, 2023
511d7bb
style: make `ParselyAPIConnection#exception` private
wzieba Oct 19, 2023
0abdfe1
refactor: extract `purgeEventsQueue` method
wzieba Oct 19, 2023
ce361ec
style: update modifier for `purgeStoredQueue`
wzieba Oct 19, 2023
a52c368
build: add MockWebServer dependency
wzieba Oct 19, 2023
06dd9e9
tests: introduce `FakeTracker`
wzieba Oct 19, 2023
de1eb9e
tests: request without pixels case
wzieba Oct 19, 2023
1fec8bd
tests: request with pixels case
wzieba Oct 19, 2023
f490db8
style: remove unnecessary secure id assignment
wzieba Oct 20, 2023
7c23c66
style: minor code-style improvements
wzieba Oct 20, 2023
d23c26b
tests: update test names to match when-then schema
wzieba Oct 20, 2023
9cf12c7
tests: update GET request test to wait for task to finish
wzieba Oct 20, 2023
85e93ed
tests: update POST request test to wait for task to finish
wzieba Oct 20, 2023
2cc22a9
style: move url declaration to "given"
wzieba Oct 20, 2023
80e50fc
tests: add test for purging events queue when successful request is made
wzieba Oct 20, 2023
6e0496c
tests: add test for not purging events queue when unsuccessful reques…
wzieba Oct 20, 2023
b83d9a7
style: make `url` definition test-wide
wzieba Oct 20, 2023
4fd33d5
tests: update test names to add missing given condition
wzieba Oct 20, 2023
1db601c
tests: verify that flush timer is stopped after succesful response
wzieba Oct 20, 2023
2aa0c87
tests: verify that flush timer is not stopped after unsuccessful resp…
wzieba Oct 20, 2023
fd9e883
tests: change FakeTracker from object to class
wzieba Oct 20, 2023
e938e6e
refactor: change result type of `ParselyAPIConnection` to `Void`
wzieba Oct 20, 2023
2d68472
refactor: extract EngagementManager
wzieba Oct 20, 2023
2b3b07d
feat: make `enqueueEvent` package-visible
wzieba Oct 20, 2023
f197f13
refactor: use getters instead of field values
wzieba Oct 20, 2023
663d5c7
tests: record first event after given interval
wzieba Oct 20, 2023
b437f8a
refactor: extract `updateLatestInterval`
wzieba Oct 20, 2023
29b8021
refactor: update tracker and manager to use interval calculator
wzieba Oct 20, 2023
65c9513
tests: record event after each interval
wzieba Oct 20, 2023
11cb57f
tests: introduce `typealias Event`
wzieba Oct 24, 2023
0c42ea3
tests: improve "start manager" test case
wzieba Oct 24, 2023
1f3c1b6
style: suppress `UNCHECKED_CAST` on `EngagementManagerTest`
wzieba Oct 24, 2023
4c3b5e9
style: extract event assertions
wzieba Oct 24, 2023
a4bf800
tests: narrow down timestamp condition in single event record case
wzieba Oct 24, 2023
203a5c8
tests: simplify single event test case
wzieba Oct 24, 2023
496b180
tests: add test case for validity of subsequent events
wzieba Oct 24, 2023
320adb6
style: move tearDown below setUp
wzieba Oct 23, 2023
73e22b9
refactor: move JSON pixel payload to a file
wzieba Oct 23, 2023
1c10d70
tests: extract `data` to variable
wzieba Oct 25, 2023
e591c93
style: move helper method below test cases
wzieba Oct 25, 2023
d287a53
refactor: introduce `Clock`
wzieba Oct 26, 2023
f717089
style: move assertions to single-line
wzieba Oct 26, 2023
54e3239
fix: remove unwanted log from interval calculator
wzieba Oct 26, 2023
4d0b3e1
tests: decrease the timestamp threshold on single-event case
wzieba Oct 26, 2023
7877a39
style: move unchecked cast suppress closer to warning
wzieba Oct 26, 2023
e0c108b
style: move private methods closer in test
wzieba Oct 26, 2023
2c7222a
style: static code readability improvements
wzieba Oct 26, 2023
0237e35
style: remove redundant casting of `baseEventData`
wzieba Oct 26, 2023
c997778
tests: make interval calculator constants package-private
wzieba Oct 26, 2023
7b45029
tests: add test setup of `UpdateEngagementIntervalCalculator`
wzieba Oct 26, 2023
93a13df
tests: add test case for the same start and current time
wzieba Oct 26, 2023
ea6c00d
tests: add test case for interval > max interval time
wzieba Oct 26, 2023
e0b5503
tests: add test case for interval calculations after some time since …
wzieba Oct 26, 2023
8f05805
refactor: automated rewrite to Kotlin
wzieba Oct 26, 2023
42f6981
fix: incorrect interval calculation
wzieba Oct 26, 2023
11daa5e
tests: update test cases to assert on the correct values
wzieba Oct 26, 2023
4276974
refactor: Clock uses `kotlin.time.Duration` now
wzieba Oct 26, 2023
5bd2b26
refactor: do not use plain number fields for calculator constants any…
wzieba Oct 26, 2023
2eef6ca
style: simplify calculator name
wzieba Oct 26, 2023
cf7a4cc
style: minor test comments improvements
wzieba Oct 26, 2023
cd4a8df
style: add empty lines at the end of files
wzieba Oct 26, 2023
4ebb3fd
tests: use static values (not calculated) in max time between heartbe…
wzieba Oct 26, 2023
f1bec2b
fix: align max time between heartbeats with iOS: 15 minutes
wzieba Oct 26, 2023
2d60e5c
tests: update the test case to match new max value between heartbeats
wzieba Oct 26, 2023
fc70360
tests: add setup for functional tests
wzieba Oct 27, 2023
4a1f1fa
tests: initialize ParselyTracker in functional test
wzieba Oct 27, 2023
eb31361
tests: assert lack of local storage file when running test
wzieba Oct 27, 2023
729c40e
tests: test case for "app tracks events above queue size limit"
wzieba Oct 27, 2023
e7d53d4
tests: do not wait for file changes in functional tests
wzieba Oct 27, 2023
6ac717d
tests: assert the correct payload size
wzieba Oct 27, 2023
5b25e59
ci: run functional tests on CI
wzieba Oct 27, 2023
328143e
build: extract dependencies version
wzieba Oct 29, 2023
e206107
style: extract name of local storage file to val
wzieba Oct 29, 2023
7edf70d
refactor: simplify code with waitFor function for locally stored events
wzieba Oct 29, 2023
dba68eb
style: use `@SuppressWarnings` instead of a comment
wzieba Oct 30, 2023
d3e2487
fix: add `intern` to `ROOT_URL` of emulator localhost
wzieba Oct 30, 2023
609f701
ci: use `connectedDebugAndroidTest`
wzieba Oct 30, 2023
e506df7
chore: remove unused `testBuildType` config
wzieba Oct 30, 2023
ec0f30a
refactor: extract local storage related code
wzieba Nov 1, 2023
07079dd
tests: test that `expelStoredEvent` doesn't have an effect
wzieba Nov 2, 2023
d2066e3
tests: add unit tests coverage for LocalStorageRepository
wzieba Nov 2, 2023
63eb02c
fix: add the correct visibility modifier to `persistObject` method
wzieba Nov 2, 2023
675508b
tests: assert correct serialization of the Java file
wzieba Nov 2, 2023
b59244d
Rename .java to .kt
wzieba Nov 2, 2023
a9d9631
refactor: move `LocalStorageRepository` to Kotlin
wzieba Nov 2, 2023
49713d8
refactor: make queues keys non-nullable
wzieba Nov 2, 2023
fac1f77
refactor: extract QueueManager to a separate class
wzieba Nov 2, 2023
93657a7
tests: add unit test coverage for QueueManager
wzieba Nov 3, 2023
1fe8772
style: make getStoredQueue a method
wzieba Nov 3, 2023
5a5f7c3
refactor: make getStoredQueue more concise
wzieba Nov 3, 2023
7700af9
Rename .java to .kt
wzieba Nov 3, 2023
fbe86d4
tests: add unit test coverage for QueueManager
wzieba Nov 3, 2023
16fce92
refactor: simplify method
wzieba Nov 6, 2023
0a3bcc3
style: add deprecation annotations
wzieba Nov 6, 2023
b3fcdbd
docs: update coordinates to STORAGE_SIZE_LIMIT const
wzieba Nov 6, 2023
a5554a7
Rename .java to .kt
wzieba Nov 6, 2023
0fbf584
refactor: move `ParselyAPIConnection` to Kotlin
wzieba Nov 6, 2023
3645773
style: add deprecation annotations
wzieba Nov 6, 2023
7c16775
ci: do not fail PR if code coverage lowered
wzieba Nov 6, 2023
44c5757
tests: add functional test for validating correct behavior on app on …
wzieba Nov 7, 2023
45000d5
style: improve test scenario comment readability
wzieba Nov 8, 2023
7d3237c
style: move suppression to file level
wzieba Nov 8, 2023
65af01e
tests: add unit test for `ParselyMetaData#toMap` method
wzieba Nov 29, 2023
cec7295
tests: add unit test for `ParselyVideoMetaData#toMap` method
wzieba Nov 29, 2023
7c77733
fix: set `toMap` methods visibility to package-private
wzieba Nov 29, 2023
a6225bf
style: address lint warnings
wzieba Nov 29, 2023
5a053d7
refactor: change type of publication date from `Calendar` to long
wzieba Nov 29, 2023
e35a7c3
Rename .java to .kt
wzieba Nov 29, 2023
8ae5bdb
refactor: migrate `ParselyMetadata` and `ParselyVideoMetadata` to kotlin
wzieba Nov 29, 2023
5e3a958
tests: add functional test for validating flushing queue
wzieba Oct 31, 2023
b5768fd
refactor: extract `FlushManager` to separate class
wzieba Oct 30, 2023
24bbacc
Rename .java to .kt
wzieba Oct 30, 2023
45affad
refactor: move the class to Kotlin
wzieba Oct 30, 2023
aca3321
refactor: make `stop` return `void`
wzieba Oct 30, 2023
1077e6e
build: add coroutines dependency
wzieba Oct 30, 2023
0ac02cb
feat: rewrite `FlushManager` to coroutines
wzieba Oct 30, 2023
01c285f
tests: add unit tests for `FlushManager`
wzieba Oct 30, 2023
bc4a7d6
tests: "double start" `FlushManager` test case
wzieba Oct 30, 2023
d1eebf9
refactor: remove unnecessary `null` check on `job`
wzieba Oct 30, 2023
8b3a2c5
tests: reduce time of default interval in tests to 5sec
wzieba Oct 31, 2023
c9dfcc4
tests: increase request waiting timeout to 2s
wzieba Oct 31, 2023
8cac908
style: simplify FlushManager to have one-liners
wzieba Nov 3, 2023
81ce844
tests: add functional stress test
wzieba Nov 6, 2023
d02f7bd
refactor: replace `AsyncTask` with Kotlin Coroutines in `QueueManager`
wzieba Nov 6, 2023
62e27bf
fix: close file streams when finished using
wzieba Nov 6, 2023
00f182d
feat: add `remove` and `persistEvent` methods
wzieba Nov 7, 2023
44d0a2c
refactor: remove `QueueManager`. Replace with `InMemoryBuffer`.
wzieba Nov 7, 2023
18b2339
feat: make `LocalStorageRepository#insertEvents` thread safe.
wzieba Nov 7, 2023
63d4e3f
feat: make SDK's `CoroutineScope` `internal`
wzieba Nov 7, 2023
8496ab7
feat: check the buffer every second
wzieba Nov 7, 2023
c7287a3
tests: add unit tests for `InMemoryBuffer`
wzieba Nov 7, 2023
45bd815
feat: introduce listener after adding an event
wzieba Nov 7, 2023
958a4e3
ci: add androidTest-results to CI job artifacts
wzieba Nov 8, 2023
d21b391
tests: update stress test to not verify removed logic
wzieba Nov 8, 2023
c61a2ce
tests: update basic tracks events scenario
wzieba Nov 8, 2023
6ca98d5
style: improve log messages
wzieba Nov 8, 2023
b3e7f45
style: remove in-memory `eventQueue`
wzieba Nov 8, 2023
cc67a71
refactor: extract json mapping logic to Kotlin object
wzieba Nov 9, 2023
ca4b951
refactor: introduce `SendEvents` use case with same logic as `Parsely…
wzieba Nov 9, 2023
70c8d7d
refactor: migrate `ParselyAPIConnection` to Coroutines
wzieba Nov 9, 2023
2d8fa28
test: update `ParselyAPIConnectionTest` to support Coroutines
wzieba Nov 9, 2023
2e9d1d4
tests: remove unit tests that checks for `GET` request on empty payload
wzieba Nov 9, 2023
f1f3395
tests: update `ROOT_URL` before `ParselyTracker` constructor
wzieba Nov 9, 2023
c3f71db
feat: closing the connection after successful request
wzieba Nov 9, 2023
a11b192
feat: close the connection after successful request
wzieba Nov 9, 2023
d7679a9
feat: make `ParselyAPIConnection` return `Result`
wzieba Nov 9, 2023
c494f85
refactor: move handling HTTP request results to `SendEvents`
wzieba Nov 9, 2023
2c835b8
tests: update unit tests to reflect current scope of work of `Parsely…
wzieba Nov 9, 2023
ddcca6f
style: move log out of
wzieba Nov 9, 2023
33bc808
tests: split adding new event tests
wzieba Nov 9, 2023
0ee130d
style: fix test name
wzieba Nov 9, 2023
fdf826c
refactor: use `LocalStorageRepository` methods directly
wzieba Nov 10, 2023
ed7acf9
refactor: use `FlushManager` methods directly
wzieba Nov 11, 2023
807b9a7
fix: on successful request, remove only sent events
wzieba Nov 11, 2023
649758f
style: remove unused methods of `LocalStorageRepository`
wzieba Nov 11, 2023
854cd27
tests: add tests for SendEvents usecase
wzieba Nov 11, 2023
268b037
refactor: move serialization details to `JsonSerializer`
wzieba Nov 11, 2023
914d343
fix: do not stop flush manager if local queue is not empty
wzieba Nov 11, 2023
c41f0e6
fix: add mutual execution for `SendEvents#invoke`
wzieba Nov 11, 2023
00bae74
refactor: remove `FlushQueue` AsyncTask
wzieba Nov 11, 2023
c3428d6
style: remove unused methods
wzieba Nov 11, 2023
7ff07b6
fix: make `LocalStorageRepository#getStoredQueue` thread safe and off…
wzieba Nov 11, 2023
c0369ed
fix: do not create a deadlock
wzieba Nov 11, 2023
eb57e1d
fix: do not specify context for `ParselyAPIConnection`
wzieba Nov 13, 2023
1c29743
tests: fix loading an empty file for `ParselyAPIConnectionTest`
wzieba Nov 13, 2023
494521a
tests: add functional test for engagement session
wzieba Nov 13, 2023
0dea1b1
Rename .java to .kt
wzieba Nov 13, 2023
ac6298a
refactor: rewrite `EngagementManager` to Kotlin
wzieba Nov 13, 2023
cacfb3c
tests: add test for `inc` parameter and `EngagementManager#stop` beha…
wzieba Nov 13, 2023
153e160
feat: use Coroutines to enqueue events in `EngagementManager`
wzieba Nov 13, 2023
2c6a50d
tests: narrow down assertions for `EngagementManager`
wzieba Nov 13, 2023
22d8b26
tests: add tests for checking `inc` parameter
wzieba Nov 13, 2023
26ec6df
style: remove unused code
wzieba Nov 13, 2023
6ba6061
tests: add unit tests for `EngagementManager#isRunning`
wzieba Nov 13, 2023
06531d4
refactor: use `Job#isActive` to determine `EngagementManager` state
wzieba Nov 13, 2023
29a5cea
style: make `baseEvent` private and immutable
wzieba Nov 13, 2023
2ccb951
refactor: drop usages of `java.util.Calendar`
wzieba Nov 13, 2023
263f497
refactor: create `deviceInfo` for every `buildEvent`
wzieba Nov 14, 2023
be20409
refactor: extract creating "device info" to a separate class
wzieba Nov 14, 2023
65da336
Rename .java to .kt
wzieba Nov 14, 2023
19cd5c8
refactor: move `DeviceInfoRepository` to Kotlin
wzieba Nov 14, 2023
a67f4a8
refactor: make `EventsBuilderTest` not test `DeviceInfoRepository`
wzieba Nov 14, 2023
ab4a05b
refactor: move `GetAdKey` to Coroutines
wzieba Nov 14, 2023
837811f
refactor: simplify AdKey retrieval
wzieba Nov 14, 2023
0bea04e
fix: remove `appname` from device info
wzieba Nov 14, 2023
2d50a74
style: remove unused imports
wzieba Nov 14, 2023
6c402f7
tests: make `EventsBuilderTest` not Robolectric test
wzieba Nov 14, 2023
ce4a755
refactor: extract getting ad key to `AdvertisementIdProvider`
wzieba Nov 14, 2023
5c03759
refactor: extract getting uuid to `UuidProvider`
wzieba Nov 14, 2023
256302f
tests: add unit tests for `UuidProvider`
wzieba Nov 14, 2023
ec061f5
refactor: do not query `ANDROID_ID` from `SharedPreferences`.
wzieba Nov 14, 2023
b74ff1d
tests: add unit tests for `AndroidDeviceInfoRepository`
wzieba Nov 14, 2023
ff2b218
refactor: rewrite SdkInit to simple function
wzieba Nov 17, 2023
73e558c
refactor: introduce `FlushManager` interface
wzieba Nov 17, 2023
211bc87
refactor: introduce `QueueManager` interface
wzieba Nov 17, 2023
16a1501
refactor: introduce `QueueManager` interface
wzieba Nov 17, 2023
fb4fc8e
refactor: introduce `RestClient` interface
wzieba Nov 17, 2023
16fd3bf
feat: start `FlushManager` without checking state of stored queue first
wzieba Nov 17, 2023
c7858a3
refactor: pass `onFlush` lambda to `ParselyFlushManager`
wzieba Nov 17, 2023
1a19e45
refactor: rename `SendEvents` to `FlushQueue` and `isDebug` to `skipS…
wzieba Nov 17, 2023
c976a1c
style: improve position of logging statements in `FlushQueue`
wzieba Nov 17, 2023
dd1f4dd
style: return from `FlushQueue` if `skipSendingEvents`
wzieba Nov 17, 2023
cdb9fb3
style: make variables test-local where possible
wzieba Nov 24, 2023
b4c3b92
feat: update lock logic on local storage repo
wzieba Nov 24, 2023
1dfdc93
style: remove unnecessary `else` from `FlushQueue`
wzieba Nov 24, 2023
14bc4d7
feat: do not stop FlushManager on successful flush
wzieba Nov 24, 2023
5b0f61a
refactor: make `startTime` a local variable
wzieba Dec 1, 2023
89ffada
fix: assign advertisement id in AdvertisementIdProvider
wzieba Dec 5, 2023
fd8f999
tests: make SUT test-scoped in AndroidDeviceInfoRepositoryTest
wzieba Dec 5, 2023
6b567be
chore: add a comment for AdvertisementIdProvider#provide
wzieba Dec 7, 2023
1a0026c
refactor: accept `List` in metadata's constructors
wzieba Dec 12, 2023
20dac54
fix: make `publicationDateMilliseconds` nullable
wzieba Dec 12, 2023
3ccba42
feat: add `null` default arguments for nullable fields
wzieba Dec 12, 2023
e9c25b7
fix: bring back `java.util.Calendar` to metadata constructors
wzieba Dec 13, 2023
a991948
refactor: extract `ConnectivityStatusProvider` to a separate class
wzieba Dec 13, 2023
ed64c5c
refactor: make returned intervals nullable fields
wzieba Dec 13, 2023
16a3981
refactor: remove `getDebug` method
wzieba Dec 13, 2023
0db7502
refactor: move `PLog` to a separate class
wzieba Dec 13, 2023
fa9717b
refactor: convert `context` to a local variable
wzieba Dec 13, 2023
6362dd3
refactor: convert `localStorageRepository` to a local variable
wzieba Dec 13, 2023
ee91fde
refactor: rename `PLog` to `log`
wzieba Dec 13, 2023
b61ba54
fix: do not throw exception in case of empty `url`
wzieba Dec 13, 2023
06965a3
style: fix minor typo in tests
wzieba Dec 13, 2023
173c764
Rename .java to .kt
wzieba Dec 13, 2023
b8d3104
refactor: convert `EventsBuilder` to Kotlin
wzieba Dec 13, 2023
caf6595
fix: do not allow users to start engagement session without tracking …
wzieba Dec 13, 2023
688fdf6
fix: update signature of `ParselyMetadata#toMap` methods
wzieba Dec 13, 2023
fb1afc7
fix: update signature of `buildEvent` method
wzieba Dec 13, 2023
5ce8239
fix: make Logging object internal
wzieba Dec 13, 2023
51d0ade
feat: use `Clock` for getting time in `EventsBuilder`
wzieba Dec 14, 2023
a86c207
style: remove unused imports and runTest
wzieba Dec 14, 2023
919778f
Add optional pageType parameter to ParselyMetadata class in Android SDK
MartinAkram Jan 17, 2024
dae740f
Add missing comma to ParselyMetadata object
MartinAkram Jan 17, 2024
0e94336
Fix broken test in ParselyMetadataTest
MartinAkram Jan 17, 2024
d981f2e
Remove missed comma in ParselyMetadataTest
MartinAkram Jan 17, 2024
1adfb44
Actually fix the tests for real this time
MartinAkram Jan 17, 2024
c2eb7e5
Fix test
MartinAkram Jan 17, 2024
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
40 changes: 40 additions & 0 deletions .github/workflows/readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ jobs:
run: ./gradlew :example:assembleDebug
- name: Android Lint
run: ./gradlew lintDebug
- name: Android Unit Tests
run: ./gradlew :parsely:testDebugUnitTest
- name: Generate XML coverage report
run: ./gradlew :parsely:koverXmlReportDebug
- uses: codecov/codecov-action@v3
with:
files: parsely/build/reports/kover/reportDebug.xml
token: ${{ secrets.CODECOV_TOKEN }}
- name: Validate Maven publication
run: ./gradlew :parsely:publishReleasePublicationToMavenLocal
env:
Expand All @@ -35,3 +43,35 @@ jobs:
with:
name: artifact
path: ~/.m2/repository/com/parsely/parsely/*
functional-tests:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Functional Tests
uses: reactivecircus/[email protected]
with:
working-directory: .
api-level: 31
profile: Nexus 6
arch: x86_64
force-avd-creation: false
avd-name: macOS-avd-x86_64-31
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: ./gradlew :parsely:connectedDebugAndroidTest
- name: Publish build artifacts
uses: actions/upload-artifact@v3
if: always()
with:
name: artifact
path: |
./parsely/build/reports/*
./parsely/build/outputs/androidTest-results
7 changes: 7 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
github_checks:
annotations: false

coverage:
status:
project: off
patch: off
21 changes: 3 additions & 18 deletions example/src/main/java/com/example/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,18 @@ protected void onCreate(Bundle savedInstanceState) {
// Set debugging to true so we don't actually send things to Parse.ly
ParselyTracker.sharedInstance().setDebug(true);

final TextView queueView = (TextView) findViewById(R.id.queue_size);
queueView.setText(String.format("Queued events: %d", ParselyTracker.sharedInstance().queueSize()));

final TextView storedView = (TextView) findViewById(R.id.stored_size);
storedView.setText(String.format("Stored events: %d", ParselyTracker.sharedInstance().storedEventsCount()));

final TextView intervalView = (TextView) findViewById(R.id.interval);
storedView.setText(String.format("Flush interval: %d", ParselyTracker.sharedInstance().getFlushInterval()));

updateEngagementStrings();

final TextView views[] = new TextView[3];
views[0] = queueView;
views[1] = storedView;
views[2] = intervalView;
final TextView views[] = new TextView[1];
views[0] = intervalView;

final Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
TextView[] v = (TextView[]) msg.obj;
TextView qView = v[0];
qView.setText(String.format("Queued events: %d", ParselyTracker.sharedInstance().queueSize()));

TextView sView = v[1];
sView.setText(String.format("Stored events: %d", ParselyTracker.sharedInstance().storedEventsCount()));

TextView iView = v[2];
TextView iView = v[0];
if (ParselyTracker.sharedInstance().flushTimerIsActive()) {
iView.setText(String.format("Flush Interval: %d", ParselyTracker.sharedInstance().getFlushInterval()));
} else {
Expand Down
19 changes: 2 additions & 17 deletions example/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,26 +68,11 @@
android:onClick="trackReset"
android:text="@string/button_reset_video" />

<TextView
android:id="@+id/queue_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/reset_video_button"
android:layout_centerHorizontal="true"
android:text="Queued events: 0" />

<TextView android:id="@+id/stored_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_below="@id/queue_size"
android:text="Stored events: 0"/>

<TextView android:id="@+id/interval"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_below="@id/stored_size"
android:layout_below="@id/reset_video_button"
android:text="Flush timer inactive"/>

<TextView
Expand All @@ -107,4 +92,4 @@
android:text="Video is inactive." />


</RelativeLayout>
</RelativeLayout>
60 changes: 46 additions & 14 deletions parsely/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
id 'org.jetbrains.kotlinx.kover'
}

ext {
assertJVersion = '3.24.2'
coroutinesVersion = '1.7.3'
mockWebServerVersion = '4.12.0'
}

android {
Expand All @@ -8,6 +16,12 @@ android {
defaultConfig {
minSdkVersion 21
targetSdkVersion 33

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments clearPackageData: 'true'
}
testOptions {
execution 'ANDROIDX_TEST_ORCHESTRATOR'
}
buildTypes {
release {
Expand All @@ -27,27 +41,45 @@ android {
withJavadocJar()
}
}

testOptions {
unitTests {
includeAndroidResources = true
}
}

koverReport {
filters {
excludes {
classes(
"*.BuildConfig"
)
}
}
}
}

dependencies {
def kotlinVersion = "1.8.10"

implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.3'
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
implementation 'androidx.lifecycle:lifecycle-process:2.6.2'
constraints {
add("implementation", "org.jetbrains.kotlin:kotlin-stdlib-jdk7") {
version {
require(kotlinVersion)
}
}
add("implementation", "org.jetbrains.kotlin:kotlin-stdlib-jdk8") {
version {
require(kotlinVersion)
}
}
}
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion"

testImplementation 'org.robolectric:robolectric:4.10.3'
testImplementation 'androidx.test:core:1.5.0'
testImplementation "org.assertj:assertj-core:$assertJVersion"
testImplementation 'junit:junit:4.13.2'
testImplementation "com.squareup.okhttp3:mockwebserver:$mockWebServerVersion"
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion"

androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test:rules:1.5.0'
androidTestImplementation "org.assertj:assertj-core:$assertJVersion"
androidTestImplementation "com.squareup.okhttp3:mockwebserver:$mockWebServerVersion"
androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
androidTestUtil 'androidx.test:orchestrator:1.4.2'
}

apply from: "${rootProject.projectDir}/publication.gradle"
Loading