Skip to content
Merged
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
9 changes: 9 additions & 0 deletions .github/workflows/codecov_code_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
pull_request:
branches:
- 'main'
workflow_dispatch:

jobs:
build:
Expand All @@ -30,3 +31,11 @@ jobs:
name: report
files: build/reports/kover/report.xml
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload test reports
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: failure()
with:
name: test-reports
path: '**/reports/tests/**'
retention-days: 7
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import com.amplifyframework.statemachine.state.CounterStateMachine
import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit
import kotlin.test.assertEquals
import kotlin.test.assertFalse
import kotlin.test.assertTrue
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.newSingleThreadContext
Expand Down Expand Up @@ -128,22 +127,4 @@ class StateMachineListenerTests {
stateMachine.send(Counter.Event("2", eventType = Increment))
assertTrue { listenLatch.await(5, TimeUnit.SECONDS) }
}

@Test
fun testNoNotifyImmediateCancel() {
stateMachine.send(Counter.Event("1", eventType = Increment))
val listenLatch = CountDownLatch(1)
val token = StateChangeListenerToken()
stateMachine.listen(
token,
{
listenLatch.countDown()
},
null
)

stateMachine.cancel(token)
stateMachine.send(Counter.Event("2", eventType = Increment))
assertFalse { listenLatch.await(5, TimeUnit.SECONDS) }
}
}