-
Notifications
You must be signed in to change notification settings - Fork 1
1367 lines (1331 loc) · 54.5 KB
/
unit_test_linux_ubuntu.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
name: Unit Test (Linux-Ubuntu)
run-name: Unit Test (Linux-Ubuntu)
on:
push:
branches:
- main
# schedule:
# run every night at 00:00
# - cron: '0 0 * * *'
workflow_dispatch:
inputs:
RUN_OR_NOT:
description: 'Run or not?'
required: true
default: true
type: boolean
# global vars
env:
MO_CTL_GIT_URL: "https://raw.githubusercontent.com/matrixorigin/mo_ctl_standalone/main/"
GO_PROXY: "https://proxy.golang.org"
MO_HOST: "127.0.0.1"
MO_PORT: "6001"
MO_USER: "dump"
MO_PW: "111"
OPTION_LIST: "auto_backup,backup,clean_backup,connect,ddl_convert,deploy,get_branch,get_cid,get_conf,pprof,precheck,restart,set_conf,start,status,stop,uninstall,upgrade,watchdog"
MO_PATH: "/home/runner/mo"
MO_STABLE_VERSION: "v1.0.0"
MO_STABLE_BRANCH: "(HEAD detached at v1.0.0)"
# last updated: 2023/10/9
MO_STABLE_CID: "daf86797160585d24c158e4ee220964264616505"
MO_TEST_CID_1: "654ce16"
MO_TEST_BRANCH_1: "(HEAD detached at 654ce16d5)"
MO_TEST_CID_2: "6fb41d2"
MO_TEST_BRANCH_2: "(HEAD detached at 6fb41d210)"
MO_MAIN_BRANCH: "main"
MO_PPROF_PATH: "/home/runner/pprof_test"
TEST_SQL_PATH: "/home/runner/sql_test_path"
TEST_SQL_FILE_1: "${TEST_SQL_PATH}/q1.sql"
TEST_SQL_FILE_2: "${TEST_SQL_PATH}/q2.sql"
TEST_SQL_FILE_3: "${TEST_SQL_PATH}/q3.sql"
MO_GIT_URL_1: https://ghproxy.com/github.com/matrixorigin/matrixone.git
MO_GIT_URL_2: https://ghproxy.com/github.com/matrixorigin/matrixone.git
BACKUP_PATH: "/home/runner/mo-backup"
# job def
jobs:
# Job 1
Test-01-Tool:
runs-on: ubuntu-latest
steps:
- name: Test_1. 'install.sh'
run: |
echo "Step_1. install mo_ctl with Internet(no proxy)"
wget ${{ env.MO_CTL_GIT_URL }}/install.sh && bash +x ./install.sh
mo_ctl help
echo ""
echo "Step_2. install mo_ctl with Internet(proxy)"
wget https://ghproxy.com/https://github.com/matrixorigin/mo_ctl_standalone/blob/main/install.sh && bash +x install.sh
mo_ctl help
echo ""
echo "Step_3. install mo_ctl without Internet"
wget ${{ env.MO_CTL_GIT_URL }}/install.sh
wget https://github.com/matrixorigin/mo_ctl_standalone/archive/refs/heads/main.zip -O mo_ctl.zip
bash +x ./install.sh mo_ctl.zip
mo_ctl help
- name: Test_2. 'uninstall.sh'
run: |
echo "Step_1. uninstall mo_ctl"
wget ${{ env.MO_CTL_GIT_URL }}/uninstall.sh && echo "yes" | bash +x ./uninstall.sh
echo ""
echo "Step_2. check if mo_ctl has been uninstalled"
if which mo_ctl; then
echo "mo_ctl found in PATH: $PATH, Failed"
exit 1
else
echo "No mo_ctl found in PATH: $PATH"
fi
if [[ -d ~/mo_ctl/ ]]; then
echo "Path ~/mo_ctl/ is not removed, Failed"
ls -lth ~/mo_ctl/
exit 1
else
echo "Path ~/mo_ctl/ has been removed"
fi
# Job 2
Test-02-Help:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
run: |
echo "install mo_ctl with Internet(no proxy)"
wget ${{ env.MO_CTL_GIT_URL }}/install.sh && bash +x ./install.sh
- name: Test_1. 'mo_ctl help' (show usage)
run: |
echo ""
mo_ctl help
- name: Test_2. 'mo_ctl [option_1] help' (valid option_1)
run: |
i=1
for option in $(echo ${{ env.OPTION_LIST }} | sed "s/,/ /g"); do
echo ""
echo "Loop number: ${i}, option: ${option}, command: mo_ctl ${option} help"
mo_ctl ${option} help
((i++))
done
- name: Test_3. 'mo_ctl xxx' (invalid option_1)
run: |
if mo_ctl xxx; then
echo "'mo_ctl xxx' should fail but it didn't"
exit 1
fi
- name: Test_4. 'mo_ctl xxx help' (invalid option_1 help)
run: |
if mo_ctl xxx help; then
echo "'mo_ctl xxx help' should fail but it didn't"
exit 1
fi
# Job 3
Test-03-Get-And-Set-Conf:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
run: |
echo "install mo_ctl with Internet(no proxy)"
wget ${{ env.MO_CTL_GIT_URL }}/install.sh && bash +x ./install.sh
- name: Test_1. 'mo_ctl get_conf [all]' (get all confs)
run: |
mo_ctl set_conf TOOL_LOG_LEVEL="D"
echo ""
echo "test_cmd: mo_ctl get_conf"
mo_ctl get_conf
echo ""
echo "test_cmd: mo_ctl get_conf all"
mo_ctl get_conf all
- name: Test_2. 'mo_ctl get_conf MO_PORT' (get single conf)
run: |
echo ""
echo "test_cmd: mo_ctl get_conf MO_PROT"
mo_ctl get_conf MO_PORT
- name: Test_3. 'mo_ctl get_conf MO_USER,MO_PW' (get multiple conf)
run: |
echo ""
echo "test_cmd: mo_ctl get_conf MO_USER,MO_PW"
mo_ctl get_conf MO_USER,MO_PW
- name: Test_4. 'mo_ctl get_conf xxx' (wrong way to get conf)
run: |
echo ""
echo "test_cmd: mo_ctl get_conf xx || mo_ctl get_conf MO_USER,yy || mo_ctl get_conf MO_USER=yy"
if mo_ctl get_conf xx || mo_ctl get_conf MO_USER,yy || mo_ctl get_conf MO_USER=yy; then
echo "'mo_ctl get_conf' does not fail as expected"
exit 1
fi
- name: Test_5. 'mo_ctl set_conf MO_USER' (set single conf)
run: |
echo ""
echo "test_cmd: mo_ctl set_conf MO_USER=\"mike\""
mo_ctl set_conf MO_USER="mike"
mo_ctl get_conf MO_USER | grep "mike"
- name: Test_6. 'mo_ctl set_conf MO_USER="mike",MO_PW="M@trix0riginRocks"' (set multiple conf)
run: |
echo ""
#echo "test_cmd: mo_ctl set_conf MO_USER=\"mike\",MO_PW=\"M@trix0riginRocks\""
#mo_ctl set_conf MO_USER="mike",MO_PW="M@trix0riginRocks"
#mo_ctl get_conf MO_USER | grep "mike"
#mo_ctl get_conf MO_PW | grep "M@trix0riginRocks"
- name: Test_7. 'mo_ctl set_conf MO_USER="mike" MO_PW="M@trix0riginRocks"' (set multiple conf)
run: |
echo ""
#echo "test_cmd: mo_ctl set_conf MO_USER=\"mike\" MO_PW=\"M@trix0riginRocks\""
#mo_ctl set_conf MO_USER="mike" MO_PW="M@trix0riginRocks"
#mo_ctl get_conf MO_USER | grep "mike"
#mo_ctl get_conf MO_PW | grep "M@trix0riginRocks"
- name: Test_8. 'mo_ctl set_conf xxx' (wrong way to set conf)
run: |
echo ""
#echo "test_cmd: mo_ctl set_conf xx || mo_ctl set_conf MO_USER=\"mike\",yy || mo_ctl set_conf MO_USER=\"mike\",yy=\"test\" || mo_ctl set_conf MO_USER=\"mike\" yy=\"test\""
echo "test_cmd: mo_ctl set_conf xx || mo_ctl set_conf yy=\"test\""
#if mo_ctl set_conf xx || mo_ctl set_conf MO_USER="mike",yy ||mo_ctl set_conf MO_USER="mike",yy="test" || mo_ctl set_conf MO_USER="mike" yy="test"; then
if mo_ctl set_conf xx || mo_ctl set_conf yy="test"; then
echo "'mo_ctl set_conf' does not fail as expected"
exit 1
fi
- name: Test_9. 'mo_ctl set_conf MO_GIT_URL' (special settings)
run: |
echo ""
echo "test_cmd: mo_ctl set_conf ${{ env.MO_GIT_URL_1 }}"
if mo_ctl set_conf ${{ env.MO_GIT_URL_1 }}; then
echo "failed"
exit 1
fi
echo "test_cmd: mo_ctl set_conf ${{ env.MO_GIT_URL_2 }}"
if mo_ctl set_conf ${{ env.MO_GIT_URL_2 }}; then
echo "failed"
exit 1
fi
- name: Test_10. 'mo_ctl set_conf reset' (reset all confs to default)
run: |
echo ""
echo "test_cmd: echo \"yes\" | mo_ctl set_conf reset"
echo "yes"| mo_ctl set_conf reset
# Job 4
Test-04-Precheck:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
run: |
echo "install mo_ctl with Internet(no proxy)"
wget ${{ env.MO_CTL_GIT_URL }}/install.sh && bash +x ./install.sh
- name: Test_1. 'mo_ctl precheck' (when precheck succeeds)
run: |
echo ""
mo_ctl set_conf TOOL_LOG_LEVEL="D"
mo_ctl precheck
echo "'mo_ctl precheck' succeeds as expected"
- name: Test_2. 'mo_ctl precheck' (when precheck fails)
run: |
echo ""
echo "Removing mysql client"
mysql_file=`which mysql`
sudo rm -f ${mysql_file}
if ! mo_ctl precheck; then
echo "'mo_ctl precheck' fails as expected"
fi
# Job 5-1
Test-05-01-Deloy-Uninstall-Latest-Version:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
run: |
echo "install mo_ctl with Internet(no proxy)"
wget ${{ env.MO_CTL_GIT_URL }}/install.sh && bash +x ./install.sh
mkdir -p ${{ env.MO_PATH }}
- name: Test_1. 'mo_ctl deploy main' (deploy latest commit id on main)
run: |
echo ""
RUN_TAG="$(date "+%Y%m%d_%H%M%S")"
mo_ctl set_conf MO_PATH="${{ env.MO_PATH }}/${RUN_TAG}"
mo_ctl set_conf GOPROXY="${{ env.GO_PROXY }}"
mo_ctl set_conf TOOL_LOG_LEVEL="D"
echo "MO_PATH: ${{ env.MO_PATH }}/${RUN_TAG}, test_cmd: mo_ctl deploy main"
mo_ctl deploy main
- name: Test_2. 'mo_ctl get_branch' (get current branch)
run: |
mo_ctl get_branch
branch=`mo_ctl get_branch | tail -n 1 | awk -F'current branch: ' '{print $2}'`
echo "branch is ${branch}"
if [[ "${branch}" != "${{ env.MO_MAIN_BRANCH }}" ]]; then
echo "Failed to get_branch or branch is not that as expected"
exit 1
fi
- name: Test_3. 'mo_ctl get_cid' (get commit id)
run: |
mo_ctl get_cid
cid=`mo_ctl get_cid less | sed -n '2p'`
if [[ "${cid}" == "" ]]; then
echo "Failed to get_cid or cid is not that as expected"
exit 1
fi
- name: Test_4. 'mo_ctl version' (get mo_ctl and mo version)
run: |
echo ""
mo_ctl version
- name: Test_5. 'mo_ctl uninstall' (uninstall mo)
run: |
echo ""
mo_ctl stop force
echo "yes" | mo_ctl uninstall
if [[ -d "${{ env.MO_PATH }}/${RUN_TAG}/matrixone" ]]; then
echo "Uninstall failed"
exit 1
fi
# Job 5-2
Test-05-02-Deloy-Uninstall-Stable:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
run: |
echo "install mo_ctl with Internet(no proxy)"
wget ${{ env.MO_CTL_GIT_URL }}/install.sh && bash +x ./install.sh
mkdir -p ${{ env.MO_PATH }}
- name: Test_1. 'mo_ctl deploy [default_version]' (deploy current stable version)
run: |
echo ""
RUN_TAG="$(date "+%Y%m%d_%H%M%S")"
mo_ctl set_conf MO_PATH="${{ env.MO_PATH }}/${RUN_TAG}"
mo_ctl set_conf GOPROXY="${{ env.GO_PROXY }}"
mo_ctl set_conf TOOL_LOG_LEVEL="D"
echo "MO_PATH: ${{ env.MO_PATH }}/${RUN_TAG}, test_cmd: mo_ctl deploy ${{ env.MO_STABLE_VERSION }}"
mo_ctl deploy ${{ env.MO_STABLE_VERSION }}
- name: Test_2. 'mo_ctl get_branch' (get current branch)
run: |
mo_ctl get_branch
branch=`mo_ctl get_branch | tail -n 1 | awk -F'current branch: ' '{print $2}'`
echo "branch is: ${branch}"
if [[ "${branch}" != "${{ env.MO_STABLE_BRANCH }}" ]]; then
echo "Failed to get_branch or branch is not that as expected: ${{ env.MO_STABLE_BRANCH }}"
echo "expected branch: ${{ env.MO_STABLE_BRANCH }}, actual branch: ${${branch}}"
exit 1
fi
- name: Test_3. 'mo_ctl get_cid' (get commit id)
run: |
mo_ctl get_cid
cid=`mo_ctl get_cid less | sed -n '2p'`
if [[ "${cid}" == "" ]]; then
echo "Failed to get_cid or cid is not that as expected"
exit 1
fi
- name: Test_4. 'mo_ctl uninstall' (uninstall mo)
run: |
echo ""
mo_ctl stop force
echo "yes" | mo_ctl uninstall
if [[ -d "${{ env.MO_PATH }}/${RUN_TAG}/matrixone" ]]; then
echo "Uninstall failed"
exit 1
fi
# Job 5-3
Test-05-03-Deloy-Uninstall-Cid1:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
run: |
echo "install mo_ctl with Internet(no proxy)"
wget ${{ env.MO_CTL_GIT_URL }}/install.sh && bash +x ./install.sh
mkdir -p ${{ env.MO_PATH }}
- name: Test_1. 'mo_ctl deploy 38888f7' (deploy a valid commit id)
run: |
echo ""
RUN_TAG="$(date "+%Y%m%d_%H%M%S")"
mo_ctl set_conf MO_PATH="${{ env.MO_PATH }}/${RUN_TAG}"
mo_ctl set_conf TOOL_LOG_LEVEL="D"
echo "MO_PATH: ${{ env.MO_PATH }}/${RUN_TAG}, test_cmd: mo_ctl deploy ${{ env.MO_TEST_CID_1 }}"
mo_ctl deploy ${{ env.MO_TEST_CID_1 }}
- name: Test_2. 'mo_ctl get_branch' (get current branch)
run: |
mo_ctl get_branch
branch=`mo_ctl get_branch | tail -n 1 | awk -F'current branch: ' '{print $2}'`
echo "branch is ${branch}"
if [[ "${branch}" != "${{ env.MO_TEST_BRANCH_1 }}" ]]; then
echo "Failed to get_branch or branch is not that as expected"
exit 1
fi
- name: Test_3. 'mo_ctl get_cid' (get commit id)
run: |
mo_ctl get_cid
cid=`mo_ctl get_cid less | sed -n '2p'`
if ! echo "${cid}" | grep ${{ env.MO_TEST_CID_1}} ; then
echo "Failed to get_cid or cid is not that as expected"
exit 1
fi
- name: Test_4. 'mo_ctl uninstall' (uninstall mo)
run: |
echo ""
mo_ctl stop force
echo "yes" | mo_ctl uninstall
if [[ -d "${{ env.MO_PATH }}/${RUN_TAG}/matrixone" ]]; then
echo "Uninstall failed"
exit 1
fi
# Job 5-4
Test-05-04-Deloy-Uninstall-Latest-Force:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
run: |
echo "install mo_ctl with Internet(no proxy)"
wget ${{ env.MO_CTL_GIT_URL }}/install.sh && bash +x ./install.sh
mkdir -p ${{ env.MO_PATH }}
- name: Test_1. 'mo_ctl deploy main force' (deploy latest commit id on main with force option)
run: |
echo ""
RUN_TAG="$(date "+%Y%m%d_%H%M%S")"
mo_ctl set_conf MO_PATH="${{ env.MO_PATH }}/${RUN_TAG}"
mo_ctl set_conf GOPROXY="${{ env.GO_PROXY }}"
mo_ctl set_conf TOOL_LOG_LEVEL="D"
mkdir -p ${{ env.MO_PATH }}/${RUN_TAG}
echo "123" > ${{ env.MO_PATH }}/${RUN_TAG}/123.txt
echo "listing test file and its content: ${{ env.MO_PATH }}/${RUN_TAG}/123.txt"
ls -lth ${{ env.MO_PATH }}/${RUN_TAG}/123.txt
cat ${{ env.MO_PATH }}/${RUN_TAG}/123.txt
echo "MO_PATH: ${{ env.MO_PATH }}/${RUN_TAG}, test_cmd: echo \"yes\" | mo_ctl deploy main force"
echo "yes" | mo_ctl deploy main force
- name: Test_2. 'mo_ctl get_branch' (get current branch)
run: |
mo_ctl get_branch
branch=`mo_ctl get_branch | tail -n 1 | awk -F'current branch: ' '{print $2}'`
echo "branch is ${branch}"
if [[ "${branch}" != "${{ env.MO_MAIN_BRANCH }}" ]]; then
echo "Failed to get_branch or branch is not that as expected"
exit 1
fi
- name: Test_3. 'mo_ctl get_cid' (get commit id)
run: |
mo_ctl get_cid
cid=`mo_ctl get_cid less | sed -n '2p'`
if [[ "${cid}" == "" ]]; then
echo "Failed to get_cid or cid is not that as expected"
exit 1
fi
- name: Test_4. 'mo_ctl uninstall' (uninstall mo)
run: |
echo ""
mo_ctl stop force
echo "yes" | mo_ctl uninstall
if [[ -d "${{ env.MO_PATH }}/${RUN_TAG}/matrixone" ]]; then
echo "Uninstall failed"
exit 1
fi
# Job 5-5
Test-05-05-Deloy-Uninstall-Invalid:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
run: |
echo "install mo_ctl with Internet(no proxy)"
wget ${{ env.MO_CTL_GIT_URL }}/install.sh && bash +x ./install.sh
mkdir -p ${{ env.MO_PATH }}
- name: Test_1. 'mo_ctl deploy 12345678' (deploy an invalid commit id)
run: |
echo ""
RUN_TAG="$(date "+%Y%m%d_%H%M%S")"
mo_ctl set_conf MO_PATH="${{ env.MO_PATH }}/${RUN_TAG}"
mo_ctl set_conf TOOL_LOG_LEVEL="D"
echo "MO_PATH: ${{ env.MO_PATH }}/${RUN_TAG}, test_cmd: mo_ctl deploy 12345678"
if mo_ctl deploy 12345678; then
echo "Deploy should fail when deploying an invalid commit id, but it didn't"
exit 1
fi
# Job 6
Test-06-Start-Status-Stop-Restart:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
run: |
echo "install mo_ctl with Internet(no proxy)"
wget ${{ env.MO_CTL_GIT_URL }}/install.sh && bash +x ./install.sh
mkdir -p ${{ env.MO_PATH }}
RUN_TAG="$(date "+%Y%m%d_%H%M%S")"
mo_ctl set_conf MO_PATH="${{ env.MO_PATH }}/${RUN_TAG}"
mo_ctl set_conf GOPROXY="${{ env.GO_PROXY }}"
echo "MO_PATH: ${{ env.MO_PATH }}/${RUN_TAG}, test_cmd: mo_ctl deploy main"
mo_ctl deploy main
mo_ctl set_conf TOOL_LOG_LEVEL="D"
- name: Test_1. 'mo_ctl status' (no mo-service running)
run: |
echo ""
if ! mo_ctl status; then
echo "'mo_ctl status' fails as expected"
fi
- name: Test_2. 'mo_ctl start'
run: |
echo ""
mo_ctl start && mo_ctl status
- name: Test_3. 'mo_ctl status' (mo-service running)
run: |
echo ""
mo_ctl status
echo "'mo_ctl status' succeeds as expected"
- name: Test_4. 'mo_ctl stop'
run: |
echo ""
mo_ctl stop
if ! mo_ctl status; then
echo "Stop as expected"
fi
- name: Test_5. 'mo_ctl restart'
run: |
echo ""
mo_ctl restart && mo_ctl status
- name: Test_6. 'mo_ctl stop force'
run: |
echo ""
mo_ctl stop force
if ! mo_ctl status; then
echo "Stop force as expected"
fi
- name: Test_7. 'mo_ctl restart'
run: |
echo ""
mo_ctl restart force && mo_ctl status
# Job 7
Test-07-Connect:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
run: |
echo "install mo_ctl with Internet(no proxy)"
wget ${{ env.MO_CTL_GIT_URL }}/install.sh && bash +x ./install.sh
mkdir -p ${{ env.MO_PATH }}
RUN_TAG="$(date "+%Y%m%d_%H%M%S")"
mo_ctl set_conf MO_PATH="${{ env.MO_PATH }}/${RUN_TAG}"
mo_ctl set_conf GOPROXY="${{ env.GO_PROXY }}"
echo "MO_PATH: ${{ env.MO_PATH }}/${RUN_TAG}, test_cmd: mo_ctl deploy main"
mo_ctl deploy main
echo "Sleep 5 seconds and start mo-service"
sleep 5 && mo_ctl start
echo "Check mo-service status"
mo_ctl status
echo "Sleep 30 seconds for mo to be ready"
sleep 30
mo_ctl set_conf TOOL_LOG_LEVEL="D"
- name: Test_1. 'mo_ctl connect' (mo-service running)
run: |
echo ""
echo "select version()" | mo_ctl connect
- name: Test_2. 'mo_ctl connect' (mo-service not running)
run: |
echo ""
mo_ctl stop force
if mo_ctl status; then
echo "Failed to stop mo-service"
exit 1
fi
if echo "select version()" | mo_ctl connect; then
echo "When mo-service is not running, mo_ctl connect should fail but it didn't"
exit 1
fi
# Job 8
Test-08-Sql:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
run: |
echo "install mo_ctl with Internet(no proxy)"
wget ${{ env.MO_CTL_GIT_URL }}/install.sh && bash +x ./install.sh
mkdir -p ${{ env.MO_PATH }}
RUN_TAG="$(date "+%Y%m%d_%H%M%S")"
mo_ctl set_conf MO_PATH="${{ env.MO_PATH }}/${RUN_TAG}"
mo_ctl set_conf GOPROXY="${{ env.GO_PROXY }}"
echo "MO_PATH: ${{ env.MO_PATH }}/${RUN_TAG}, test_cmd: mo_ctl deploy main"
mo_ctl deploy main
echo "Sleep 5 seconds and start mo-service"
sleep 5 && mo_ctl start
echo "Check mo-service status"
mo_ctl status
echo "Sleep 30 seconds for mo to be ready"
sleep 30
echo "Create test path and test files"
mkdir -p ${{ env.TEST_SQL_PATH }}
echo "select version();" > ${{ env.TEST_SQL_FILE_1 }}
echo "select 1;" > ${{ env.TEST_SQL_FILE_2 }}
echo "select @@sql_mode;" > ${{ env.TEST_SQL_FILE_3 }}
mo_ctl set_conf TOOL_LOG_LEVEL="D"
- name: Test_1. 'mo_ctl sql "[sql_query]"' (valid)
run: |
echo ""
mo_ctl sql "select version()"
- name: Test_2. 'mo_ctl sql "[sql_query]"' (invalid)
run: |
echo ""
if mo_ctl sql "select xx from xx;"; then
echo "Invalid sql query does not fail as expected"
exit 1
fi
- name: Test_3. 'mo_ctl sql "[sql_file]"' (valid)
run: |
mo_ctl sql ${{ env.TEST_SQL_FILE_1 }}
- name: Test_4. 'mo_ctl sql "[sql_file]"' (invalid)
run: |
echo ""
if mo_ctl sql /tmp/123/456/789.txt; then
echo "Invalid sql file does not fail as expected"
exit 1
fi
- name: Test_5. 'mo_ctl sql "[sql_path]"' (valid)
run: |
mo_ctl sql ${{ env.TEST_SQL_PATH }}
- name: Test_6. 'mo_ctl sql "[sql_path]"' (invalid)
run: |
if mo_ctl sql /tmp/123/456/789/; then
echo "Invalid sql path does not fail as expected"
exit 1
fi
- name: Test_7. 'mo_ctl sql ""' (empty input)
run: |
if mo_ctl sql || mo_sql sql ""; then
echo "Invalid sql path does not fail as expected"
exit 1
fi
# Job 9
Test-09-Watchdog:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
run: |
echo "install mo_ctl with Internet(no proxy)"
wget ${{ env.MO_CTL_GIT_URL }}/install.sh && bash +x ./install.sh
mkdir -p ${{ env.MO_PATH }}
RUN_TAG="$(date "+%Y%m%d_%H%M%S")"
mo_ctl set_conf MO_PATH="${{ env.MO_PATH }}/${RUN_TAG}"
mo_ctl set_conf GOPROXY="${{ env.GO_PROXY }}"
echo "MO_PATH: ${{ env.MO_PATH }}/${RUN_TAG}, test_cmd: mo_ctl deploy main"
mo_ctl deploy main
mo_ctl set_conf TOOL_LOG_LEVEL="D"
- name: Test_1. 'mo_ctl watchdog' (check disabled status)
run: |
echo ""
if mo_ctl watchdog || mo_ctl watchdog status; then
echo "mo_ctl watchdog does not fail as expected"
exit 1
fi
- name: Test_2. 'mo_ctl watchdog enable' (enable watchdog)
run: |
echo ""
if ! mo_ctl watchdog enable; then
echo "'mo_ctl watchdog enable' failed"
exit 1
fi
echo "Sleep 65 seconds and see if mo-service is running"
sleep 65
mo_ctl status
- name: Test_3. 'mo_ctl watchdog' (check enabled status)
run: |
echo ""
if mo_ctl watchdog && mo_ctl watchdog status; then
echo "'mo_ctl watchdog' succeeds as expected"
else
echo "'mo_ctl watchdog' failed"
exit 1
fi
- name: Test_4. 'mo_ctl watchdog disable' (disable watchdog)
run: |
echo "Stop mo-service"
if ! mo_ctl stop; then
mo_ctl stop force
fi
echo "Disable mo watchdog"
mo_ctl watchdog disable
echo "Check mo_watchdog stauts"
if mo_ctl watchdog || mo_ctl watchdog status; then
echo "mo_ctl watchdog does not fail as expected"
exit 1
fi
echo "Sleep 65 seconds and see if mo-service will not be pulled up running"
sleep 65
if mo_ctl status; then
echo "mo-service is still in running status, seems like disabling watchdog did not succeed as expected"
exit 1
fi
# Job 10
Test-10-Pprof:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
run: |
echo "install mo_ctl with Internet(no proxy)"
wget ${{ env.MO_CTL_GIT_URL }}/install.sh && bash +x ./install.sh
mkdir -p ${{ env.MO_PATH }}
RUN_TAG="$(date "+%Y%m%d_%H%M%S")"
mo_ctl set_conf MO_PATH="${{ env.MO_PATH }}/${RUN_TAG}"
mo_ctl set_conf GOPROXY="${{ env.GO_PROXY }}"
echo "MO_PATH: ${{ env.MO_PATH }}/${RUN_TAG}, test_cmd: mo_ctl deploy main"
mo_ctl deploy main
echo "Sleep 5 seconds and start mo-service"
sleep 5 && mo_ctl start
echo "Check mo-service status"
mo_ctl status
echo "Sleep 30 seconds for mo to be ready"
sleep 30
mkdir -p ${{ env.MO_PPROF_PATH }}
mo_ctl set_conf PPROF_OUT_PATH="${{ env.MO_PPROF_PATH }}"
mo_ctl set_conf TOOL_LOG_LEVEL="D"
- name: Test_1. 'mo_ctl pprof' (collect profile for default 30 seconds)
run: |
echo ""
mo_ctl pprof
ls -lth ${{ env.MO_PPROF_PATH }}/
if [[ "`ls ${{ env.MO_PPROF_PATH }}/ | wc -l | sed s/[[:space:]]//g`" != "1" ]]; then
echo "No file is generated in ${{ env.MO_PPROF_PATH }}/"
exit 1
fi
cd ${{ env.MO_PPROF_PATH }}/ && rm -f ./*
- name: Test_2. 'mo_ctl pprof profile' (collect profile for default 30 seconds)
run: |
echo ""
mo_ctl pprof profile
ls -lth ${{ env.MO_PPROF_PATH }}/
if [[ "`ls ${{ env.MO_PPROF_PATH }}/ | wc -l | sed s/[[:space:]]//g`" != "1" ]]; then
echo "No file is generated in ${{ env.MO_PPROF_PATH }}/"
exit 1
fi
cd ${{ env.MO_PPROF_PATH }}/ && rm -f ./*
- name: Test_3. 'mo_ctl pprof profile 15' (collect profile for 15 seconds)
run: |
echo ""
mo_ctl pprof profile 15
ls -lth ${{ env.MO_PPROF_PATH }}/
if [[ "`ls ${{ env.MO_PPROF_PATH }}/ | wc -l | sed s/[[:space:]]//g`" != "1" ]]; then
echo "No file is generated in ${{ env.MO_PPROF_PATH }}/"
exit 1
fi
cd ${{ env.MO_PPROF_PATH }}/ && rm -f ./*
- name: Test_4. 'mo_ctl pprof heap' (collect heap)
run: |
echo ""
mo_ctl pprof heap
ls -lth ${{ env.MO_PPROF_PATH }}/
if [[ "`ls ${{ env.MO_PPROF_PATH }}/ | wc -l | sed s/[[:space:]]//g`" != "1" ]]; then
echo "No file is generated in ${{ env.MO_PPROF_PATH }}/"
exit 1
fi
cd ${{ env.MO_PPROF_PATH }}/ && rm -f ./*
- name: Test_5. 'mo_ctl pprof allocs' (collect allocs)
run: |
echo ""
mo_ctl pprof allocs
ls -lth ${{ env.MO_PPROF_PATH }}/
if [[ "`ls ${{ env.MO_PPROF_PATH }}/ | wc -l | sed s/[[:space:]]//g`" != "1" ]]; then
echo "No file is generated in ${{ env.MO_PPROF_PATH }}/"
exit 1
fi
cd ${{ env.MO_PPROF_PATH }}/ && rm -f ./*
# Job 11-1
Test-11-01-Upgrade-Stable-To-Latest:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
run: |
echo "install mo_ctl with Internet(no proxy)"
wget ${{ env.MO_CTL_GIT_URL }}/install.sh && bash +x ./install.sh
mkdir -p ${{ env.MO_PATH }}
- name: Test_1. 'mo_ctl deploy [current_stable_version]' (deploy current stable version)
run: |
echo ""
RUN_TAG="$(date "+%Y%m%d_%H%M%S")"
mo_ctl set_conf MO_PATH="${{ env.MO_PATH }}/${RUN_TAG}"
mo_ctl set_conf GOPROXY="${{ env.GO_PROXY }}"
echo "MO_PATH: ${{ env.MO_PATH }}/${RUN_TAG}, test_cmd: mo_ctl deploy ${{ env.MO_STABLE_VERSION }}"
mo_ctl deploy ${{ env.MO_STABLE_VERSION }}
mo_ctl get_cid
mo_ctl set_conf TOOL_LOG_LEVEL="D"
- name: Test_2. 'mo_ctl start' (start mo-service) and prepare some data
run: |
mo_ctl start
echo "Sleeping 30 seconds for mo to be ready"
sleep 30
echo "Prepare some data"
mo_ctl sql "create database test; use test; create table tb1(id int, name varchar(50)); insert into test.tb1 values (1, 'Andy'),(2,'Becky'),(3,'Cindy'),(4,'David'),(5,'Emma'),(6,'Francis')"
mo_ctl sql "select count(*) from test.tb1; select * from test.tb1"
- name: Test_3. 'mo_ctl upgrade latest' (current stable version -> latest commit id)
run: |
if ! mo_ctl stop; then
mo_ctl stop force
fi
echo "Sleep 5 seconds before upgrading"
sleep 5
mo_ctl upgrade latest
mo_ctl start
echo "Sleep 30 seconds for mo to be ready"
sleep 30
if ! mo_ctl sql "select count(*) from test.tb1; select * from test.tb1"; then
echo "Run query failed. This may be due to incompatible data format when upgrading from one cid to another"
fi
# Job 11-2
Test-11-02-Downgrade-Latest-To-Stable:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
run: |
echo "install mo_ctl with Internet(no proxy)"
wget ${{ env.MO_CTL_GIT_URL }}/install.sh && bash +x ./install.sh
mkdir -p ${{ env.MO_PATH }}
- name: Test_1. 'mo_ctl deploy main' (deploy latest commit id)
run: |
echo ""
RUN_TAG="$(date "+%Y%m%d_%H%M%S")"
mo_ctl set_conf MO_PATH="${{ env.MO_PATH }}/${RUN_TAG}"
mo_ctl set_conf GOPROXY="${{ env.GO_PROXY }}"
echo "MO_PATH: ${{ env.MO_PATH }}/${RUN_TAG}, test_cmd: mo_ctl deploy latest"
mo_ctl deploy main
mo_ctl get_cid
mo_ctl set_conf TOOL_LOG_LEVEL="D"
- name: Test_2. 'mo_ctl start' (start mo-service) and prepare some data
run: |
mo_ctl start
echo "Sleeping 30 seconds for mo to be ready"
sleep 30
echo "Prepare some data"
mo_ctl sql "create database test; use test; create table tb1(id int, name varchar(50)); insert into test.tb1 values (1, 'Andy'),(2,'Becky'),(3,'Cindy'),(4,'David'),(5,'Emma'),(6,'Francis')"
mo_ctl sql "select count(*) from test.tb1; select * from test.tb1"
- name: Test_3. 'mo_ctl upgrade [current_stable_version]' (latest commit id -> current stable version)
run: |
if ! mo_ctl stop; then
mo_ctl stop force
fi
echo "Sleep 5 seconds before upgrading"
sleep 5
mo_ctl upgrade ${{ env.MO_STABLE_VERSION }}
if ! mo_ctl start; then
echo "Start mo-service failed. This may be due to incompatible data format when upgrading from one cid to another. Ignoring... "
fi
echo "Sleep 30 seconds for mo to be ready"
sleep 30
if ! mo_ctl sql "select count(*) from test.tb1; select * from test.tb1"; then
echo "Run query failed. This may be due to incompatible data format when upgrading from one cid to another. Ignoring... "
fi
# Job 11-3
Test-11-03-Upgrade-Stable-To-Cid1:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
run: |
echo "install mo_ctl with Internet(no proxy)"
wget ${{ env.MO_CTL_GIT_URL }}/install.sh && bash +x ./install.sh
mkdir -p ${{ env.MO_PATH }}
- name: Test_1. 'mo_ctl deploy [current_stable_version]' (deploy current stable version)
run: |
echo ""
RUN_TAG="$(date "+%Y%m%d_%H%M%S")"
mo_ctl set_conf MO_PATH="${{ env.MO_PATH }}/${RUN_TAG}"
mo_ctl set_conf GOPROXY="${{ env.GO_PROXY }}"
echo "MO_PATH: ${{ env.MO_PATH }}/${RUN_TAG}, test_cmd: mo_ctl deploy ${{ env.MO_STABLE_VERSION }}"
mo_ctl deploy ${{ env.MO_STABLE_VERSION }}
mo_ctl get_cid
mo_ctl set_conf TOOL_LOG_LEVEL="D"
- name: Test_2. 'mo_ctl start' (start mo-service) and prepare some data
run: |
mo_ctl start
echo "Sleeping 30 seconds for mo to be ready"
sleep 30
echo "Prepare some data"
mo_ctl sql "create database test; use test; create table tb1(id int, name varchar(50)); insert into test.tb1 values (1, 'Andy'),(2,'Becky'),(3,'Cindy'),(4,'David'),(5,'Emma'),(6,'Francis')"
mo_ctl sql "select count(*) from test.tb1; select * from test.tb1"
- name: Test_3. 'mo_ctl upgrade [cid_1]' (current stable version -> cid_1)
run: |
if ! mo_ctl stop; then
mo_ctl stop force
fi
echo "Sleep 5 seconds before upgrading"
sleep 5
mo_ctl upgrade ${{ env.MO_TEST_CID_1 }}
mo_ctl start
echo "Sleep 30 seconds for mo to be ready"
sleep 30
if ! mo_ctl sql "select count(*) from test.tb1; select * from test.tb1"; then
echo "Run query failed. This may be due to incompatible data format when upgrading from one cid to another"
fi
# Job 11-4
Test-11-04-Downgrade-Cid1-To-Stable:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
run: |
echo "install mo_ctl with Internet(no proxy)"
wget ${{ env.MO_CTL_GIT_URL }}/install.sh && bash +x ./install.sh
mkdir -p ${{ env.MO_PATH }}
- name: Test_1. 'mo_ctl deploy [cid_1]' (deploy cid_1)
run: |
echo ""
RUN_TAG="$(date "+%Y%m%d_%H%M%S")"
mo_ctl set_conf MO_PATH="${{ env.MO_PATH }}/${RUN_TAG}"
mo_ctl set_conf GOPROXY="${{ env.GO_PROXY }}"
echo "MO_PATH: ${{ env.MO_PATH }}/${RUN_TAG}, test_cmd: mo_ctl deploy ${{ env.MO_TEST_CID_1 }}"
mo_ctl deploy ${{ env.MO_TEST_CID_1 }}
mo_ctl get_cid
mo_ctl set_conf TOOL_LOG_LEVEL="D"
- name: Test_2. 'mo_ctl start' (start mo-service) and prepare some data
run: |
mo_ctl start
echo "Sleeping 30 seconds for mo to be ready"
sleep 30
echo "Prepare some data"
mo_ctl sql "create database test; use test; create table tb1(id int, name varchar(50)); insert into test.tb1 values (1, 'Andy'),(2,'Becky'),(3,'Cindy'),(4,'David'),(5,'Emma'),(6,'Francis')"
mo_ctl sql "select count(*) from test.tb1; select * from test.tb1"
- name: Test_3. 'mo_ctl upgrade [current_stable_version]' (cid_1 -> current stable version)
run: |
if ! mo_ctl stop; then
mo_ctl stop force
fi
echo "Sleep 5 seconds before upgrading"
sleep 5
mo_ctl upgrade ${{ env.MO_STABLE_VERSION }}
if ! mo_ctl start; then
echo "Start mo-service failed. This may be due to incompatible data format when upgrading from one cid to another. Ignoring... "
fi
echo "Sleep 30 seconds for mo to be ready"
sleep 30
if ! mo_ctl sql "select count(*) from test.tb1; select * from test.tb1"; then
echo "Run query failed. This may be due to incompatible data format when upgrading from one cid to another. Ignoring... "
fi
# Job 11-5
Test-11-05-Upgrade-Cid1-to-Cid2:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
run: |
echo "install mo_ctl with Internet(no proxy)"
wget ${{ env.MO_CTL_GIT_URL }}/install.sh && bash +x ./install.sh
mkdir -p ${{ env.MO_PATH }}
- name: Test_1. 'mo_ctl deploy [cid_1]' (deploy cid_1)
run: |
echo ""
RUN_TAG="$(date "+%Y%m%d_%H%M%S")"
mo_ctl set_conf MO_PATH="${{ env.MO_PATH }}/${RUN_TAG}"
mo_ctl set_conf GOPROXY="${{ env.GO_PROXY }}"
echo "MO_PATH: ${{ env.MO_PATH }}/${RUN_TAG}, test_cmd: mo_ctl deploy ${{ env.MO_TEST_CID_1 }}"
mo_ctl deploy ${{ env.MO_TEST_CID_1 }}
mo_ctl get_cid
mo_ctl set_conf TOOL_LOG_LEVEL="D"
- name: Test_2. 'mo_ctl start' (start mo-service) and prepare some data
run: |
mo_ctl start
echo "Sleeping 30 seconds for mo to be ready"
sleep 30
echo "Prepare some data"
mo_ctl sql "create database test; use test; create table tb1(id int, name varchar(50)); insert into test.tb1 values (1, 'Andy'),(2,'Becky'),(3,'Cindy'),(4,'David'),(5,'Emma'),(6,'Francis')"
mo_ctl sql "select count(*) from test.tb1; select * from test.tb1"
- name: Test_3. 'mo_ctl upgrade [cid_2]' (cid_1 -> cid_2)
run: |
if ! mo_ctl stop; then
mo_ctl stop force
fi
sleep 5
echo "Sleep 5 seconds before upgrading"
mo_ctl upgrade ${{ env.MO_TEST_CID_2 }}
mo_ctl start
echo "Sleep 30 seconds for mo to be ready"
sleep 30
if ! mo_ctl sql "select count(*) from test.tb1; select * from test.tb1"; then
echo "Run query failed. This may be due to incompatible data format when upgrading from one cid to another"
fi
# Job 11-6
Test-11-06-Downgrade-Cid2-to-Cid1:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
run: |
echo "install mo_ctl with Internet(no proxy)"
wget ${{ env.MO_CTL_GIT_URL }}/install.sh && bash +x ./install.sh
mkdir -p ${{ env.MO_PATH }}
- name: Test_1. 'mo_ctl deploy [cid_2]' (deploy cid_2)
run: |
echo ""
RUN_TAG="$(date "+%Y%m%d_%H%M%S")"
mo_ctl set_conf MO_PATH="${{ env.MO_PATH }}/${RUN_TAG}"
mo_ctl set_conf GOPROXY="${{ env.GO_PROXY }}"
echo "MO_PATH: ${{ env.MO_PATH }}/${RUN_TAG}, test_cmd: mo_ctl deploy ${{ env.MO_TEST_CID_2 }}"
mo_ctl deploy ${{ env.MO_TEST_CID_2 }}
mo_ctl get_cid
mo_ctl set_conf TOOL_LOG_LEVEL="D"
- name: Test_2. 'mo_ctl start' (start mo-service) and prepare some data
run: |
mo_ctl start
echo "Sleeping 30 seconds for mo to be ready"
sleep 30
echo "Prepare some data"
mo_ctl sql "create database test; use test; create table tb1(id int, name varchar(50)); insert into test.tb1 values (1, 'Andy'),(2,'Becky'),(3,'Cindy'),(4,'David'),(5,'Emma'),(6,'Francis')"
mo_ctl sql "select count(*) from test.tb1; select * from test.tb1"
- name: Test_3. 'mo_ctl upgrade [cid_1]' (cid_2 -> cid_1)
run: |
if ! mo_ctl stop; then
mo_ctl stop force
fi
echo "Sleep 5 seconds before upgrading"
sleep 5
mo_ctl upgrade ${{ env.MO_STABLE_VERSION }}
if ! mo_ctl start; then
echo "Start mo-service failed. This may be due to incompatible data format when upgrading from one cid to another. Ignoring... "
fi
echo "Sleep 30 seconds for mo to be ready"
sleep 30
if ! mo_ctl sql "select count(*) from test.tb1; select * from test.tb1"; then
echo "Run query failed. This may be due to incompatible data format when upgrading from one cid to another. Ignoring... "
fi
# Job 11-7
Test-11-07-Upgrade-Cid1-to-Latest:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
run: |
echo "install mo_ctl with Internet(no proxy)"
wget ${{ env.MO_CTL_GIT_URL }}/install.sh && bash +x ./install.sh
mkdir -p ${{ env.MO_PATH }}
- name: Test_1. 'mo_ctl deploy [cid_1]' (deploy cid_1)
run: |
echo ""
RUN_TAG="$(date "+%Y%m%d_%H%M%S")"
mo_ctl set_conf MO_PATH="${{ env.MO_PATH }}/${RUN_TAG}"
mo_ctl set_conf GOPROXY="${{ env.GO_PROXY }}"
echo "MO_PATH: ${{ env.MO_PATH }}/${RUN_TAG}, test_cmd: mo_ctl deploy ${{ env.MO_TEST_CID_1 }}"
mo_ctl deploy ${{ env.MO_TEST_CID_1 }}
mo_ctl get_cid