xcherryio / xcherry

server and main repo of xCherry project
Apache License 2.0
26 stars 1 forks source link

Add graceful complete and force fail #44

Closed zklgame closed 11 months ago

zklgame commented 11 months ago

Why make this pull request?

Support GracefulComplete and ForceFail StateDecision.

What has changed

How to test this pull request?

https://github.com/xdblab/xdb-golang-sdk/pull/15

codecov[bot] commented 11 months ago

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (c21df66) 54.67% compared to head (747d833) 58.11%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #44 +/- ## ========================================== + Coverage 54.67% 58.11% +3.44% ========================================== Files 39 39 Lines 2385 2550 +165 ========================================== + Hits 1304 1482 +178 + Misses 963 955 -8 + Partials 118 113 -5 ``` | [Files](https://app.codecov.io/gh/xdblab/xdb/pull/44?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=xdblab) | Coverage Δ | | |---|---|---| | [extensions/postgres/transactional.go](https://app.codecov.io/gh/xdblab/xdb/pull/44?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=xdblab#diff-ZXh0ZW5zaW9ucy9wb3N0Z3Jlcy90cmFuc2FjdGlvbmFsLmdv) | `64.81% <ø> (-12.97%)` | :arrow_down: | | [persistence/data\_models\_json\_fields.go](https://app.codecov.io/gh/xdblab/xdb/pull/44?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=xdblab#diff-cGVyc2lzdGVuY2UvZGF0YV9tb2RlbHNfanNvbl9maWVsZHMuZ28=) | `90.16% <100.00%> (-4.67%)` | :arrow_down: | | [persistence/sql/sqltest/base\_basic.go](https://app.codecov.io/gh/xdblab/xdb/pull/44?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=xdblab#diff-cGVyc2lzdGVuY2Uvc3FsL3NxbHRlc3QvYmFzZV9iYXNpYy5nbw==) | `100.00% <100.00%> (ø)` | | | [persistence/sql/sqltest/common.go](https://app.codecov.io/gh/xdblab/xdb/pull/44?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=xdblab#diff-cGVyc2lzdGVuY2Uvc3FsL3NxbHRlc3QvY29tbW9uLmdv) | `100.00% <100.00%> (ø)` | | | [persistence/sql/sql\_process\_store.go](https://app.codecov.io/gh/xdblab/xdb/pull/44?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=xdblab#diff-cGVyc2lzdGVuY2Uvc3FsL3NxbF9wcm9jZXNzX3N0b3JlLmdv) | `58.64% <82.35%> (+1.89%)` | :arrow_up: | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/xdblab/xdb/pull/44/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=xdblab)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

zklgame commented 11 months ago

Lgtm. It would be better to rebase to main branch and add some new test case for the completeExecute persistence api. The latest commit in main branch has made it simpler to add new persistence test case (see my msg in WeChat )

Added two more tests based on my best understanding. Though I think each test needs a long setup. Maybe we need to further refactor the testing codes to make a common setup.

longquanzheng commented 11 months ago

Lgtm. It would be better to rebase to main branch and add some new test case for the completeExecute persistence api. The latest commit in main branch has made it simpler to add new persistence test case (see my msg in WeChat )

Added two more tests based on my best understanding. Though I think each test needs a long setup. Maybe we need to further refactor the testing codes to make a common setup.

I think the way “testMain” works is that it will reuse the same setup. You can see that it will only create test database once

zklgame commented 11 months ago

Lgtm. It would be better to rebase to main branch and add some new test case for the completeExecute persistence api. The latest commit in main branch has made it simpler to add new persistence test case (see my msg in WeChat )

Added two more tests based on my best understanding. Though I think each test needs a long setup. Maybe we need to further refactor the testing codes to make a common setup.

I think the way “testMain” works is that it will reuse the same setup. You can see that it will only create test database once

The setup I am talking about is start process and completeExecute to run other states. Now for each test I need to do the same operations. So I think we can put the start process and start other states operations in a common shared testing logic?

zklgame commented 11 months ago

The integ test failed after merging due to https://github.com/xdblab/xdb-golang-sdk/pull/17.