From 7e45ece282f45e55750d98a74759e4937d2da505 Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Tue, 8 Sep 2020 11:29:52 +0800 Subject: [PATCH 01/19] test --- ui/tests/e2e/login.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ui/tests/e2e/login.test.ts b/ui/tests/e2e/login.test.ts index 49238da1bd..ce1e74c97c 100644 --- a/ui/tests/e2e/login.test.ts +++ b/ui/tests/e2e/login.test.ts @@ -21,6 +21,13 @@ describe('Login', () => { await ppExpect(page).toFill('input#tidb_signin_password', 'any') await ppExpect(page).toClick('button#signin_btn') await ppExpect(page).toMatch('TiDB authentication failed') + + // test + const failedReason = await page.waitForSelector( + 'form#tidb_signin div.ant-form-item-explain' + ) + const content = await failedReason.evaluate((n) => n.innerText) + console.log(content) }, 10 * 1000 ) From 1bda1360c45732ec689c3233af415abf4631d29f Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Tue, 8 Sep 2020 11:41:17 +0800 Subject: [PATCH 02/19] wip --- ui/tests/e2e/login.test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/tests/e2e/login.test.ts b/ui/tests/e2e/login.test.ts index ce1e74c97c..5df381666b 100644 --- a/ui/tests/e2e/login.test.ts +++ b/ui/tests/e2e/login.test.ts @@ -20,14 +20,15 @@ describe('Login', () => { await ppExpect(page).toFill('input#tidb_signin_password', 'any') await ppExpect(page).toClick('button#signin_btn') - await ppExpect(page).toMatch('TiDB authentication failed') // test const failedReason = await page.waitForSelector( 'form#tidb_signin div.ant-form-item-explain' ) const content = await failedReason.evaluate((n) => n.innerText) - console.log(content) + console.log('fail reason:', content) + + await ppExpect(page).toMatch('TiDB authentication failed') }, 10 * 1000 ) @@ -39,6 +40,7 @@ describe('Login', () => { await page.goto(LOGIN_URL) const title = await page.title() + console.log('title:', title) expect(title).toBe('TiDB Dashboard') const loginBtn = await page.waitForSelector('button#signin_btn') From eeebb98fe1bfe45547cdb33fdeac5e853566679c Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Tue, 8 Sep 2020 11:55:12 +0800 Subject: [PATCH 03/19] wip --- .github/workflows/e2e-test.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e-test.yaml b/.github/workflows/e2e-test.yaml index 4c55365be4..5e9ae90456 100644 --- a/.github/workflows/e2e-test.yaml +++ b/.github/workflows/e2e-test.yaml @@ -46,7 +46,8 @@ jobs: run: | curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh source /home/runner/.profile - tiup update --nightly + tiup update --nightly --all + tiup update --self tiup playground nightly --tiflash=0 & - name: Build UI run: | From 047c4ece309bf9083ac2b369a2ebcce47f8d954a Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Tue, 8 Sep 2020 11:59:27 +0800 Subject: [PATCH 04/19] wip --- .github/workflows/e2e-test.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e-test.yaml b/.github/workflows/e2e-test.yaml index 5e9ae90456..9d57267611 100644 --- a/.github/workflows/e2e-test.yaml +++ b/.github/workflows/e2e-test.yaml @@ -46,9 +46,10 @@ jobs: run: | curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh source /home/runner/.profile - tiup update --nightly --all + tiup update --all tiup update --self - tiup playground nightly --tiflash=0 & + source /home/runner/.profile + tiup playground --tiflash=0 & - name: Build UI run: | make ui From c4599c36e20e3306f0647eaaf18407476cd65f0d Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Tue, 8 Sep 2020 13:52:20 +0800 Subject: [PATCH 05/19] wip --- ui/tests/e2e/login.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/tests/e2e/login.test.ts b/ui/tests/e2e/login.test.ts index 5df381666b..772beffe0d 100644 --- a/ui/tests/e2e/login.test.ts +++ b/ui/tests/e2e/login.test.ts @@ -40,7 +40,6 @@ describe('Login', () => { await page.goto(LOGIN_URL) const title = await page.title() - console.log('title:', title) expect(title).toBe('TiDB Dashboard') const loginBtn = await page.waitForSelector('button#signin_btn') From 669cfd9c789bc9c95825276e4caef0db745eb0e9 Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Tue, 8 Sep 2020 14:26:22 +0800 Subject: [PATCH 06/19] wip --- .github/workflows/e2e-test.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e-test.yaml b/.github/workflows/e2e-test.yaml index 9d57267611..27e8d8ff55 100644 --- a/.github/workflows/e2e-test.yaml +++ b/.github/workflows/e2e-test.yaml @@ -61,10 +61,11 @@ jobs: run: | source /home/runner/.profile tiup --version + snap install loop-rs --beta + /snap/bin/loop-rs --every 15s --until-success --num 20 -- tiup playground display ls /home/runner/.tiup/components/playground/ DATA_PATH=$(ls /home/runner/.tiup/data/) echo $DATA_PATH - tiup playground display echo "==== TiDB Log ====" head -n 3 /home/runner/.tiup/data/$DATA_PATH/tidb-0/tidb.log echo "==== TiKV Log ====" From 847f04d4b9131546cbc1f7f31e3da2cd35ca75c2 Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Tue, 8 Sep 2020 14:35:43 +0800 Subject: [PATCH 07/19] wip --- .github/workflows/e2e-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-test.yaml b/.github/workflows/e2e-test.yaml index 27e8d8ff55..f138754a68 100644 --- a/.github/workflows/e2e-test.yaml +++ b/.github/workflows/e2e-test.yaml @@ -61,7 +61,7 @@ jobs: run: | source /home/runner/.profile tiup --version - snap install loop-rs --beta + sudo snap install loop-rs --beta /snap/bin/loop-rs --every 15s --until-success --num 20 -- tiup playground display ls /home/runner/.tiup/components/playground/ DATA_PATH=$(ls /home/runner/.tiup/data/) From 69becf998fec8c6ae9f709de8ea099d0ca2c0118 Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Tue, 8 Sep 2020 14:49:43 +0800 Subject: [PATCH 08/19] wip --- .github/workflows/e2e-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-test.yaml b/.github/workflows/e2e-test.yaml index f138754a68..09bd3be7d0 100644 --- a/.github/workflows/e2e-test.yaml +++ b/.github/workflows/e2e-test.yaml @@ -62,7 +62,7 @@ jobs: source /home/runner/.profile tiup --version sudo snap install loop-rs --beta - /snap/bin/loop-rs --every 15s --until-success --num 20 -- tiup playground display + /snap/bin/loop-rs --every 15s --until-success --num 20 -- 'tiup playground display' ls /home/runner/.tiup/components/playground/ DATA_PATH=$(ls /home/runner/.tiup/data/) echo $DATA_PATH From 05d5c924b86a18d230024b7793e4221c49ea6196 Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Tue, 8 Sep 2020 15:43:29 +0800 Subject: [PATCH 09/19] wip --- .github/workflows/e2e-test.yaml | 6 ++++-- scripts/wait_tiup_playground.sh | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100755 scripts/wait_tiup_playground.sh diff --git a/.github/workflows/e2e-test.yaml b/.github/workflows/e2e-test.yaml index 09bd3be7d0..d3f939aac1 100644 --- a/.github/workflows/e2e-test.yaml +++ b/.github/workflows/e2e-test.yaml @@ -50,6 +50,10 @@ jobs: tiup update --self source /home/runner/.profile tiup playground --tiflash=0 & + - name: Wait TiUP + run: | + chmod u+x scripts/wait_tiup_playground.sh + scripts/wait_tiup_playground.sh 15 20 - name: Build UI run: | make ui @@ -61,8 +65,6 @@ jobs: run: | source /home/runner/.profile tiup --version - sudo snap install loop-rs --beta - /snap/bin/loop-rs --every 15s --until-success --num 20 -- 'tiup playground display' ls /home/runner/.tiup/components/playground/ DATA_PATH=$(ls /home/runner/.tiup/data/) echo $DATA_PATH diff --git a/scripts/wait_tiup_playground.sh b/scripts/wait_tiup_playground.sh new file mode 100755 index 0000000000..3f12352e12 --- /dev/null +++ b/scripts/wait_tiup_playground.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# Wait unitl `tiup playground` command run success + +source /home/runner/.profile + +INTERVAL=$1 +MAX_TIMES=$2 + +for ((i=0; i<${MAX_TIMES}; i++)) +do + tiup playground display + if [ $? -eq 0 ] + then + exit 0 + fi + sleep ${INTERVAL} +done + +exit 1 From fc0c80cab8cd4187ae01f59e1dfe37b77d03b75c Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Tue, 8 Sep 2020 15:50:29 +0800 Subject: [PATCH 10/19] wip --- scripts/wait_tiup_playground.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/wait_tiup_playground.sh b/scripts/wait_tiup_playground.sh index 3f12352e12..5be5bd106b 100755 --- a/scripts/wait_tiup_playground.sh +++ b/scripts/wait_tiup_playground.sh @@ -6,6 +6,12 @@ source /home/runner/.profile INTERVAL=$1 MAX_TIMES=$2 +if [ $INTERVAL -eq "" || ${MAX_TIMES} -eq "" ] +then + echo "Usage: command " + exit 1 +fi + for ((i=0; i<${MAX_TIMES}; i++)) do tiup playground display From 1cdd776f64f84b3a06fbda33f145199442350ec4 Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Tue, 8 Sep 2020 15:53:16 +0800 Subject: [PATCH 11/19] wip --- .github/workflows/e2e-test.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e-test.yaml b/.github/workflows/e2e-test.yaml index d3f939aac1..0eda46dc10 100644 --- a/.github/workflows/e2e-test.yaml +++ b/.github/workflows/e2e-test.yaml @@ -50,10 +50,6 @@ jobs: tiup update --self source /home/runner/.profile tiup playground --tiflash=0 & - - name: Wait TiUP - run: | - chmod u+x scripts/wait_tiup_playground.sh - scripts/wait_tiup_playground.sh 15 20 - name: Build UI run: | make ui @@ -61,6 +57,10 @@ jobs: NO_MINIMIZE: true CI: true REACT_APP_MIXPANEL_TOKEN: "" + - name: Wait TiUP + run: | + chmod u+x scripts/wait_tiup_playground.sh + scripts/wait_tiup_playground.sh 15 20 - name: Debug TiUP run: | source /home/runner/.profile From 356a6405614cab033db4abc8080491b3dba346b0 Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Tue, 8 Sep 2020 16:15:34 +0800 Subject: [PATCH 12/19] wip --- scripts/wait_tiup_playground.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/scripts/wait_tiup_playground.sh b/scripts/wait_tiup_playground.sh index 5be5bd106b..36006a3019 100755 --- a/scripts/wait_tiup_playground.sh +++ b/scripts/wait_tiup_playground.sh @@ -1,22 +1,20 @@ #!/usr/bin/env bash # Wait unitl `tiup playground` command run success -source /home/runner/.profile - INTERVAL=$1 MAX_TIMES=$2 -if [ $INTERVAL -eq "" || ${MAX_TIMES} -eq "" ] -then +echo $INTERVAL +echo ${MAX_TIMES} + +if ([ -z "${INTERVAL}" ] || [ -z "${MAX_TIMES}" ]); then echo "Usage: command " exit 1 fi -for ((i=0; i<${MAX_TIMES}; i++)) -do +for ((i=0; i<${MAX_TIMES}; i++)); do tiup playground display - if [ $? -eq 0 ] - then + if [ $? -eq 0 ]; then exit 0 fi sleep ${INTERVAL} From 89a8180aed69e893552068be283a5edcd8bebd36 Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Tue, 8 Sep 2020 16:25:49 +0800 Subject: [PATCH 13/19] wip --- scripts/wait_tiup_playground.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/wait_tiup_playground.sh b/scripts/wait_tiup_playground.sh index 36006a3019..a5a6a0c4b1 100755 --- a/scripts/wait_tiup_playground.sh +++ b/scripts/wait_tiup_playground.sh @@ -12,6 +12,8 @@ if ([ -z "${INTERVAL}" ] || [ -z "${MAX_TIMES}" ]); then exit 1 fi +source /home/runner/.profile + for ((i=0; i<${MAX_TIMES}; i++)); do tiup playground display if [ $? -eq 0 ]; then From cde83bd69a5d714a386c9baea1007c79b73475b2 Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Tue, 8 Sep 2020 16:27:01 +0800 Subject: [PATCH 14/19] wip --- .github/workflows/e2e-test.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/e2e-test.yaml b/.github/workflows/e2e-test.yaml index 0eda46dc10..a455a222a3 100644 --- a/.github/workflows/e2e-test.yaml +++ b/.github/workflows/e2e-test.yaml @@ -46,6 +46,7 @@ jobs: run: | curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh source /home/runner/.profile + tiup install tidb:v4.0.5 tikv pd prometheus tiup update --all tiup update --self source /home/runner/.profile From 7e29afc481b488f6c63cf64fbd85f1dc5f315afc Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Tue, 8 Sep 2020 16:41:59 +0800 Subject: [PATCH 15/19] wip --- .github/workflows/e2e-test.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e-test.yaml b/.github/workflows/e2e-test.yaml index a455a222a3..e005dce40d 100644 --- a/.github/workflows/e2e-test.yaml +++ b/.github/workflows/e2e-test.yaml @@ -47,6 +47,7 @@ jobs: curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh source /home/runner/.profile tiup install tidb:v4.0.5 tikv pd prometheus + tiup install playground tiup update --all tiup update --self source /home/runner/.profile @@ -58,10 +59,10 @@ jobs: NO_MINIMIZE: true CI: true REACT_APP_MIXPANEL_TOKEN: "" - - name: Wait TiUP - run: | - chmod u+x scripts/wait_tiup_playground.sh - scripts/wait_tiup_playground.sh 15 20 + # - name: Wait TiUP + # run: | + # chmod u+x scripts/wait_tiup_playground.sh + # scripts/wait_tiup_playground.sh 15 20 - name: Debug TiUP run: | source /home/runner/.profile From 8c31ae5bbdacede8a0a49c6140706e7c3e472679 Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Tue, 8 Sep 2020 17:05:40 +0800 Subject: [PATCH 16/19] wip --- .github/workflows/e2e-test.yaml | 2 +- scripts/wait_tiup_playground.sh | 5 +---- ui/dashboardApp/layout/signin/index.tsx | 1 + ui/tests/e2e/login.test.ts | 10 ++++------ 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/e2e-test.yaml b/.github/workflows/e2e-test.yaml index e005dce40d..c894fa7d4b 100644 --- a/.github/workflows/e2e-test.yaml +++ b/.github/workflows/e2e-test.yaml @@ -59,7 +59,7 @@ jobs: NO_MINIMIZE: true CI: true REACT_APP_MIXPANEL_TOKEN: "" - # - name: Wait TiUP + # - name: Wait TiUP Playground # run: | # chmod u+x scripts/wait_tiup_playground.sh # scripts/wait_tiup_playground.sh 15 20 diff --git a/scripts/wait_tiup_playground.sh b/scripts/wait_tiup_playground.sh index a5a6a0c4b1..4c58bbed58 100755 --- a/scripts/wait_tiup_playground.sh +++ b/scripts/wait_tiup_playground.sh @@ -1,12 +1,9 @@ #!/usr/bin/env bash -# Wait unitl `tiup playground` command run success +# Wait unitl `tiup playground` command runs success INTERVAL=$1 MAX_TIMES=$2 -echo $INTERVAL -echo ${MAX_TIMES} - if ([ -z "${INTERVAL}" ] || [ -z "${MAX_TIMES}" ]); then echo "Usage: command " exit 1 diff --git a/ui/dashboardApp/layout/signin/index.tsx b/ui/dashboardApp/layout/signin/index.tsx index d5cf833698..733f9a3f5c 100644 --- a/ui/dashboardApp/layout/signin/index.tsx +++ b/ui/dashboardApp/layout/signin/index.tsx @@ -220,6 +220,7 @@ function TiDBSignInForm({ successRoute, onClickAlternative }) { } disabled /> { await ppExpect(page).toFill('input#tidb_signin_password', 'any') await ppExpect(page).toClick('button#signin_btn') - // test - const failedReason = await page.waitForSelector( - 'form#tidb_signin div.ant-form-item-explain' + const failReason = await page.waitForSelector( + 'form#tidb_signin div[data-e2e="password"] div.ant-form-item-explain' ) - const content = await failedReason.evaluate((n) => n.innerText) + const content = await failReason.evaluate((n) => n.innerText) console.log('fail reason:', content) - - await ppExpect(page).toMatch('TiDB authentication failed') + expect(content).toContain('TiDB authentication failed') }, 10 * 1000 ) From 50d3bbfb84fc5db24236f6835f48e64ad56e3dd6 Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Tue, 8 Sep 2020 17:38:21 +0800 Subject: [PATCH 17/19] wip --- ui/tests/e2e/login.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/tests/e2e/login.test.ts b/ui/tests/e2e/login.test.ts index 7e2dfdb460..5d92870853 100644 --- a/ui/tests/e2e/login.test.ts +++ b/ui/tests/e2e/login.test.ts @@ -22,7 +22,7 @@ describe('Login', () => { await ppExpect(page).toClick('button#signin_btn') const failReason = await page.waitForSelector( - 'form#tidb_signin div[data-e2e="password"] div.ant-form-item-explain' + 'form#tidb_signin div[data-e2e="password"] div:last-child' ) const content = await failReason.evaluate((n) => n.innerText) console.log('fail reason:', content) From 1ee9b8b0d4280ea447ec032c694d5742c6394df7 Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Tue, 15 Sep 2020 17:45:53 +0800 Subject: [PATCH 18/19] wip --- .github/workflows/e2e-test.yaml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/e2e-test.yaml b/.github/workflows/e2e-test.yaml index c894fa7d4b..8933a9bbb9 100644 --- a/.github/workflows/e2e-test.yaml +++ b/.github/workflows/e2e-test.yaml @@ -46,12 +46,9 @@ jobs: run: | curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh source /home/runner/.profile - tiup install tidb:v4.0.5 tikv pd prometheus - tiup install playground - tiup update --all - tiup update --self + tiup update playground source /home/runner/.profile - tiup playground --tiflash=0 & + tiup playground v4.0.5 --tiflash=0 & - name: Build UI run: | make ui @@ -59,10 +56,10 @@ jobs: NO_MINIMIZE: true CI: true REACT_APP_MIXPANEL_TOKEN: "" - # - name: Wait TiUP Playground - # run: | - # chmod u+x scripts/wait_tiup_playground.sh - # scripts/wait_tiup_playground.sh 15 20 + - name: Wait TiUP Playground + run: | + chmod u+x scripts/wait_tiup_playground.sh + scripts/wait_tiup_playground.sh 15 20 - name: Debug TiUP run: | source /home/runner/.profile From 6920db8d76206b204c25d65157e7596851f1517d Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Wed, 16 Sep 2020 15:28:37 +0800 Subject: [PATCH 19/19] update tidb to 4.0.6 --- .github/workflows/e2e-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-test.yaml b/.github/workflows/e2e-test.yaml index 8933a9bbb9..fb1b3f7469 100644 --- a/.github/workflows/e2e-test.yaml +++ b/.github/workflows/e2e-test.yaml @@ -48,7 +48,7 @@ jobs: source /home/runner/.profile tiup update playground source /home/runner/.profile - tiup playground v4.0.5 --tiflash=0 & + tiup playground v4.0.6 --tiflash=0 & - name: Build UI run: | make ui