-
Notifications
You must be signed in to change notification settings - Fork 15
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
Adm 793 [frontend] Reduce the time of timeout to 10 minutes #1141
Conversation
…or three settings
…rceControlClient.ts and PipelineToolClient.ts
…ourceControlClient.test.ts
…ontrolTokenEffect
…#1133) * ADM-856:[backend]feat: update buildkite feign client decoder error message * ADM-856:[backend]feat: update github feign client decoder error message * ADM-856:[backend]feat: update jira feign client decoder error message --------- Co-authored-by: guzhongren <guzhongren@live.cn>
…ork and api design (#1137) * ADM-697:[docx] docx: add docx spike the logic of calculating card rework and api design * ADM-697:[docx] docx: add spike export rework content when generate board csv * ADM-697:[docx] docx: add spike calculate rework times * ADM-697:[docx] docx: rewrite the doc of calculate rework times when don't check "Consider the 'Flag' as 'Block' * ADM-697:[docx] docx: add logic for consider flag is block * ADM-697:[docx] docx: fix some words * ADM-697:[docx] docx: add logic of judge is our need rework --------- Co-authored-by: yulongcai <yulong.cai@thoughtworks.com>
* ADM-691: [frontend] feat: add new metrics field * ADM-691: [frontend] feat: add rework setting title * ADM-691: [frontend] feat: complete basic function about rework settings * ADM-691: [frontend] feat: use redux to store fields * ADM-691: [frontend] feat: replace undefind to null * ADM-691: [frontend] feat: import config with rework times settings * ADM-691: [frontend] fix: fix unit test * ADM-691: [frontend] fix: fix unit test * ADM-691: [frontend] fix: fix unit test * ADM-691: [frontend] chore: refactor code after cr * ADM-691: [frontend] fix: fix unit test * ADM-691: [frontend] fix: fix unit test * ADM-691: [frontend] test: improve test coverage * ADM-691: [frontend] test: remove unused code * ADM-691: [frontend] test: add test for rework setting * ADM-691: [frontend] fix: fix e2e * ADM-691: [frontend] fix: fix sonar --------- Co-authored-by: Leiqiuhong <qiuhong.lei@thoughtworks.com>
…ogic (#1140) * ADM-837:[docs]feat: add half completed spike doc * ADM-837: [docs] completed spike solution for export-allMetrics button polling api. * ADM-837: [docs] completed spike design for export-allMetrics button polling api. * ADM-837: [docs] add note to notice allMetricCompleted as true --------- Co-authored-by: Yunlong Gan <yunlong.gan@thoughtworks.com>
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesYou may notice some variations in coverage metrics with the latest Coverage engine update. For more details, visit the documentation |
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesYou may notice some variations in coverage metrics with the latest Coverage engine update. For more details, visit the documentation |
Hi @doujiao-001! 👋 |
Reverify? Verify again? |
import React from 'react'; | ||
|
||
describe('ConfigButtonGroup', () => { | ||
const setup = (isVerified: boolean, isLoading: boolean, isHBTimeOut: boolean, isDisableVerifyButton: boolean) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IsHBTimeout?isConfigTimeout??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
收到,我理解是尽量避免变量名不涉及项目信息?比如IsHBTimeout中HB涉及到了,应换个普通点的名称?
}; | ||
|
||
it('should render a disabled VerifyButton with "Verified" text when isVerified is true and isLoading is false', () => { | ||
setup(true, false, false, false); // Use a different moduleType for clarity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
); | ||
}; | ||
|
||
it('should render a disabled VerifyButton with "Verified" text when isVerified is true and isLoading is false', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When - given,看一哈should given when 分别写什么
expect(screen.getByText('Verified')).toBeDisabled(); | ||
}); | ||
it('should render a VerifyButton with "Reverify" text when isHBTimeOut is true', () => { | ||
setup(false, false, true, false); // Use a different moduleType for clarity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
); | ||
}), | ||
); | ||
it('should clear email validatedError when updateField by Email', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should Given when
@@ -148,4 +143,19 @@ describe('use verify board state', () => { | |||
expect(emailFiled?.verifiedError).toBe(''); | |||
expect(tokenField?.verifiedError).toBe(''); | |||
}); | |||
|
|||
it('should set timeout is true when getVerifyBoard api is timeout', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given
|
||
it('should isHBTimeOut and isShowAlert is true when api timeout', async () => { | ||
sourceControlClient.verifyToken = jest.fn().mockResolvedValue({ | ||
code: HEARTBEAT_EXCEPTION_CODE.TIMEOUT, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为什么常量要和项目名挂钩?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个是之前存在的变量名,我再去找相关人员确认下 是否更改一下 不要包含项目名称
</StyledForm> | ||
</ConfigSectionContainer> | ||
<> | ||
<TimeoutAlert |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
能把这个组件当child传进来吗?隔离组件深度
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 1 to 2. - [Release notes](https://github.com/softprops/action-gh-release/releases) - [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md) - [Commits](softprops/action-gh-release@v1...v2) --- updated-dependencies: - dependency-name: softprops/action-gh-release dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: guzhongren <guzhongren@live.cn>
* chore: extend the overall timeout of e2e 1 more minute. * distinguish local and CI for overall timeout.
* ADM-691: [frontend] fix: add request fields * ADM-691: [frontend] fix: fix sonar cloud * ADM-691: [frontend] fix: fix unit test * ADM-691: [frontend] chore: modify sytle, rename field * ADM-691: [frontend] fix: fix sonar issue * ADM-691: [frontend] fix: remove unused code --------- Co-authored-by: Leiqiuhong <qiuhong.lei@thoughtworks.com>
|
|
@@ -40,7 +44,7 @@ describe('verify sourceControl request', () => { | |||
), | |||
); | |||
|
|||
sourceControlClient.verifyToken(MOCK_SOURCE_CONTROL_VERIFY_REQUEST_PARAMS).catch((e) => { | |||
sourceControlClient.verifyToken(MOCK_SOURCE_CONTROL_VERIFY_REQUEST_PARAMS, jest.fn(), jest.fn()).catch((e) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不要用catch接,用reject.throw接错误
@@ -58,7 +62,7 @@ describe('verify sourceControl request', () => { | |||
), | |||
); | |||
|
|||
sourceControlClient.verifyToken(MOCK_SOURCE_CONTROL_VERIFY_REQUEST_PARAMS).catch((e) => { | |||
sourceControlClient.verifyToken(MOCK_SOURCE_CONTROL_VERIFY_REQUEST_PARAMS, jest.fn(), jest.fn()).catch((e) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
一样的问题
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
原则:测试不要出现类似try catch的代码
|
||
await waitFor(() => { | ||
const isVerifyTimeOut = result.current.isVerifyTimeOut; | ||
expect(isVerifyTimeOut).toBe(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tobetruthy
|
||
await waitFor(() => { | ||
expect(result.current.isVerifyTimeOut).toEqual(true); | ||
expect(result.current.isShowAlert).toEqual(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
2new issues in sonar cloud |
* AMD-793 [frontend] feature: add reverify logic and timeout alert * AMD-793 [frontend] refactor: abstract config button component for config page * AMD-793 [frontend] refactor: abstract timeout alert component for config page * AMD-793 [frontend] feat: add timeout alert component to config page for three settings * AMD-793 [frontend] test: add test for timeout alert component * AMD-793 [frontend] test: add test for config button group component * [ADM-793] style: fix css check * AMD-793 [frontend] fix: set HB timeout and timeout alert false in SourceControlClient.ts and PipelineToolClient.ts * AMD-793 [frontend] fix: fix test for PipelineToolClient.test.ts and SourceControlClient.test.ts * [ADM-793] style: fix border css * [ADM-793] test: fix test for useVerifyBoardEffect * AMD-793 [frontend] test: add test of isHBTimeout for useVerifySourceControlTokenEffect * [ADM-793] test: add test for useVerifyPipelineToolEffect * [ADM-793] test: add test for getFieldsWithNoVerifiedError * AMD-793 [frontend] test: remove not use mock in test file and change test case name * ADM-856:[backend]feat: update all feign clients decoder error message (#1133) * ADM-856:[backend]feat: update buildkite feign client decoder error message * ADM-856:[backend]feat: update github feign client decoder error message * ADM-856:[backend]feat: update jira feign client decoder error message --------- Co-authored-by: guzhongren <guzhongren@live.cn> * ADM-697:[docx] docx: add docx spike the logic of calculating card rework and api design (#1137) * ADM-697:[docx] docx: add docx spike the logic of calculating card rework and api design * ADM-697:[docx] docx: add spike export rework content when generate board csv * ADM-697:[docx] docx: add spike calculate rework times * ADM-697:[docx] docx: rewrite the doc of calculate rework times when don't check "Consider the 'Flag' as 'Block' * ADM-697:[docx] docx: add logic for consider flag is block * ADM-697:[docx] docx: fix some words * ADM-697:[docx] docx: add logic of judge is our need rework --------- Co-authored-by: yulongcai <yulong.cai@thoughtworks.com> * ADM-691: [frontend] feat: add feat about rework settings (#1138) * ADM-691: [frontend] feat: add new metrics field * ADM-691: [frontend] feat: add rework setting title * ADM-691: [frontend] feat: complete basic function about rework settings * ADM-691: [frontend] feat: use redux to store fields * ADM-691: [frontend] feat: replace undefind to null * ADM-691: [frontend] feat: import config with rework times settings * ADM-691: [frontend] fix: fix unit test * ADM-691: [frontend] fix: fix unit test * ADM-691: [frontend] fix: fix unit test * ADM-691: [frontend] chore: refactor code after cr * ADM-691: [frontend] fix: fix unit test * ADM-691: [frontend] fix: fix unit test * ADM-691: [frontend] test: improve test coverage * ADM-691: [frontend] test: remove unused code * ADM-691: [frontend] test: add test for rework setting * ADM-691: [frontend] fix: fix e2e * ADM-691: [frontend] fix: fix sonar --------- Co-authored-by: Leiqiuhong <qiuhong.lei@thoughtworks.com> * ADM-856:[backend]feat: add decode default case error message (#1139) * ADM-837:[docs] docs: spike about optimizing generate report backend logic (#1140) * ADM-837:[docs]feat: add half completed spike doc * ADM-837: [docs] completed spike solution for export-allMetrics button polling api. * ADM-837: [docs] completed spike design for export-allMetrics button polling api. * ADM-837: [docs] add note to notice allMetricCompleted as true --------- Co-authored-by: Yunlong Gan <yunlong.gan@thoughtworks.com> * add test case * AMD-793 [frontend] style: fix color for reverify button * [ADM-793] fix: revert httpTimeout * Build(deps): bump softprops/action-gh-release from 1 to 2 (#1136) Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 1 to 2. - [Release notes](https://github.com/softprops/action-gh-release/releases) - [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md) - [Commits](softprops/action-gh-release@v1...v2) --- updated-dependencies: - dependency-name: softprops/action-gh-release dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: guzhongren <guzhongren@live.cn> * AMD-793 [frontend] fix: remove annotation in test file * AMD-793 [frontend] fix: update test name for clear * AMD-793 [frontend] fix: update test name use given when then * chore: extend the overall timeout of e2e 1 more minute. (#1144) * chore: extend the overall timeout of e2e 1 more minute. * distinguish local and CI for overall timeout. * ADM-691: [frontend] fix: add request fields (#1143) * ADM-691: [frontend] fix: add request fields * ADM-691: [frontend] fix: fix sonar cloud * ADM-691: [frontend] fix: fix unit test * ADM-691: [frontend] chore: modify sytle, rename field * ADM-691: [frontend] fix: fix sonar issue * ADM-691: [frontend] fix: remove unused code --------- Co-authored-by: Leiqiuhong <qiuhong.lei@thoughtworks.com> * ADM-691: [frontend] fix: fix sonar issue (#1145) * [ADM-793] refactor: rename AXIOS_REQUEST_ERROR_CODE * AMD-793 [frontend] fix: update alert position to keep element still * [ADM-793] feat: enhance style for alert * [ADM-793] feat: change moduleType text * [ADM-793] style: enhance style --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: yp.wu <yiping.wu@yipings-MacBook-Pro.local> Co-authored-by: xuebing <xuebing.li@thoughtworks.com> Co-authored-by: yp.wu <yiping.wu@192.168.10.4> Co-authored-by: Steveay <907221539@qq.com> Co-authored-by: guzhongren <guzhongren@live.cn> Co-authored-by: Genhao Liu <103744663+Liughgood@users.noreply.github.com> Co-authored-by: yulongcai <yulong.cai@thoughtworks.com> Co-authored-by: neomgb <123063936+neomgb@users.noreply.github.com> Co-authored-by: Leiqiuhong <qiuhong.lei@thoughtworks.com> Co-authored-by: sqsq5566 <154306546+sqsq5566@users.noreply.github.com> Co-authored-by: Yunlong Gan <yunlong.gan@thoughtworks.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: 李雪冰 <33832990+lxuebing@users.noreply.github.com> Co-authored-by: Chao <89126516+mrcuriosity-tw@users.noreply.github.com>
* AMD-793 [frontend] feature: add reverify logic and timeout alert * AMD-793 [frontend] refactor: abstract config button component for config page * AMD-793 [frontend] refactor: abstract timeout alert component for config page * AMD-793 [frontend] feat: add timeout alert component to config page for three settings * AMD-793 [frontend] test: add test for timeout alert component * AMD-793 [frontend] test: add test for config button group component * [ADM-793] style: fix css check * AMD-793 [frontend] fix: set HB timeout and timeout alert false in SourceControlClient.ts and PipelineToolClient.ts * AMD-793 [frontend] fix: fix test for PipelineToolClient.test.ts and SourceControlClient.test.ts * [ADM-793] style: fix border css * [ADM-793] test: fix test for useVerifyBoardEffect * AMD-793 [frontend] test: add test of isHBTimeout for useVerifySourceControlTokenEffect * [ADM-793] test: add test for useVerifyPipelineToolEffect * [ADM-793] test: add test for getFieldsWithNoVerifiedError * AMD-793 [frontend] test: remove not use mock in test file and change test case name * ADM-856:[backend]feat: update all feign clients decoder error message (#1133) * ADM-856:[backend]feat: update buildkite feign client decoder error message * ADM-856:[backend]feat: update github feign client decoder error message * ADM-856:[backend]feat: update jira feign client decoder error message --------- Co-authored-by: guzhongren <guzhongren@live.cn> * ADM-697:[docx] docx: add docx spike the logic of calculating card rework and api design (#1137) * ADM-697:[docx] docx: add docx spike the logic of calculating card rework and api design * ADM-697:[docx] docx: add spike export rework content when generate board csv * ADM-697:[docx] docx: add spike calculate rework times * ADM-697:[docx] docx: rewrite the doc of calculate rework times when don't check "Consider the 'Flag' as 'Block' * ADM-697:[docx] docx: add logic for consider flag is block * ADM-697:[docx] docx: fix some words * ADM-697:[docx] docx: add logic of judge is our need rework --------- Co-authored-by: yulongcai <yulong.cai@thoughtworks.com> * ADM-691: [frontend] feat: add feat about rework settings (#1138) * ADM-691: [frontend] feat: add new metrics field * ADM-691: [frontend] feat: add rework setting title * ADM-691: [frontend] feat: complete basic function about rework settings * ADM-691: [frontend] feat: use redux to store fields * ADM-691: [frontend] feat: replace undefind to null * ADM-691: [frontend] feat: import config with rework times settings * ADM-691: [frontend] fix: fix unit test * ADM-691: [frontend] fix: fix unit test * ADM-691: [frontend] fix: fix unit test * ADM-691: [frontend] chore: refactor code after cr * ADM-691: [frontend] fix: fix unit test * ADM-691: [frontend] fix: fix unit test * ADM-691: [frontend] test: improve test coverage * ADM-691: [frontend] test: remove unused code * ADM-691: [frontend] test: add test for rework setting * ADM-691: [frontend] fix: fix e2e * ADM-691: [frontend] fix: fix sonar --------- Co-authored-by: Leiqiuhong <qiuhong.lei@thoughtworks.com> * ADM-856:[backend]feat: add decode default case error message (#1139) * ADM-837:[docs] docs: spike about optimizing generate report backend logic (#1140) * ADM-837:[docs]feat: add half completed spike doc * ADM-837: [docs] completed spike solution for export-allMetrics button polling api. * ADM-837: [docs] completed spike design for export-allMetrics button polling api. * ADM-837: [docs] add note to notice allMetricCompleted as true --------- Co-authored-by: Yunlong Gan <yunlong.gan@thoughtworks.com> * add test case * AMD-793 [frontend] style: fix color for reverify button * [ADM-793] fix: revert httpTimeout * Build(deps): bump softprops/action-gh-release from 1 to 2 (#1136) Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 1 to 2. - [Release notes](https://github.com/softprops/action-gh-release/releases) - [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md) - [Commits](softprops/action-gh-release@v1...v2) --- updated-dependencies: - dependency-name: softprops/action-gh-release dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: guzhongren <guzhongren@live.cn> * AMD-793 [frontend] fix: remove annotation in test file * AMD-793 [frontend] fix: update test name for clear * AMD-793 [frontend] fix: update test name use given when then * chore: extend the overall timeout of e2e 1 more minute. (#1144) * chore: extend the overall timeout of e2e 1 more minute. * distinguish local and CI for overall timeout. * ADM-691: [frontend] fix: add request fields (#1143) * ADM-691: [frontend] fix: add request fields * ADM-691: [frontend] fix: fix sonar cloud * ADM-691: [frontend] fix: fix unit test * ADM-691: [frontend] chore: modify sytle, rename field * ADM-691: [frontend] fix: fix sonar issue * ADM-691: [frontend] fix: remove unused code --------- Co-authored-by: Leiqiuhong <qiuhong.lei@thoughtworks.com> * ADM-691: [frontend] fix: fix sonar issue (#1145) * [ADM-793] refactor: rename AXIOS_REQUEST_ERROR_CODE * AMD-793 [frontend] fix: update alert position to keep element still * [ADM-793] feat: enhance style for alert * [ADM-793] feat: change moduleType text * [ADM-793] style: enhance style --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: yp.wu <yiping.wu@yipings-MacBook-Pro.local> Co-authored-by: xuebing <xuebing.li@thoughtworks.com> Co-authored-by: yp.wu <yiping.wu@192.168.10.4> Co-authored-by: Steveay <907221539@qq.com> Co-authored-by: guzhongren <guzhongren@live.cn> Co-authored-by: Genhao Liu <103744663+Liughgood@users.noreply.github.com> Co-authored-by: yulongcai <yulong.cai@thoughtworks.com> Co-authored-by: neomgb <123063936+neomgb@users.noreply.github.com> Co-authored-by: Leiqiuhong <qiuhong.lei@thoughtworks.com> Co-authored-by: sqsq5566 <154306546+sqsq5566@users.noreply.github.com> Co-authored-by: Yunlong Gan <yunlong.gan@thoughtworks.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: 李雪冰 <33832990+lxuebing@users.noreply.github.com> Co-authored-by: Chao <89126516+mrcuriosity-tw@users.noreply.github.com>
Summary
Reduce the time of timeout to 10 minutes
Before
Description
Screenshots

After
Description
Screenshots
Note
Null