-
Notifications
You must be signed in to change notification settings - Fork 108
/
Copy path.gitlab-ci.yaml
1298 lines (1141 loc) · 39.1 KB
/
.gitlab-ci.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
stages:
- static_code_analysis
- build
- test
- cleanup
- publish
- deploy
variables:
PYTEST_NUMBER_OF_PROCESSES: 8
GIT_DEPTH: 1
GIT_SUBMODULE_DEPTH: 1
GIT_STRATEGY: clone
GIT_SUBMODULE_STRATEGY: recursive
CI_DEBUG_SERVICES: "true"
# pin to specific docker images for build repeatability
# uses registry.gitlab.syncad.com/hive/hive/ci-base-image:ubuntu22.04-12
TEST_IMAGE_TAG: "@sha256:a5863e467d2040488a5f3fb146547538a51c88d25562a3d8d49c5c7b2b889252"
# Versions of Python packages
PYTHON_JUNIT_XML_VERSION: "1.9"
PYTHON_DATEUTIL_VERSION: "2.8.2"
DATA_CACHE_HIVE_PREFIX: "/cache/replay_data_hive"
BLOCK_LOG_SOURCE_DIR_5M: /blockchain/block_log_5m
BLOCK_LOG_SOURCE_DIR_MIRRORNET_5M: /blockchain/block_log_5m_mirrornet
# Variables required by the mirrornet pipeline
MIRRORNET_CHAIN_ID: 42
MIRRORNET_SKELETON_KEY: "5JNHfZYKGaomSFvd4NUdQ9qMcEAC43kujbfjueTHpVapX1Kzq2n"
TEST_TOOLS_VALIDATE_RESPONSE_SCHEMAS: "TRUE"
# Variables required by Common CI jobs
CI_COMMON_JOB_VERSION: "1ce04340ebfe838fd7fa09aebdde3bd7e1218bce"
DOCKER_BUILDER_TAG: "$CI_COMMON_JOB_VERSION"
DOCKER_DIND_TAG: "$CI_COMMON_JOB_VERSION"
IMAGE_REMOVER_TAG: "$CI_COMMON_JOB_VERSION"
include:
- template: Workflows/Branch-Pipelines.gitlab-ci.yml
- local: '/scripts/ci-helpers/prepare_data_image_job.yml'
- local: '/scripts/ci-helpers/mirrornet_jobs.gitlab-ci.yml'
- project: 'hive/common-ci-configuration'
ref: e74d7109838ff05fdc239bced6a726aa7ad46a9b
file:
- '/templates/npm_projects.gitlab-ci.yml'
- '/templates/wasm_build.gitlab-ci.yml'
- '/templates/python_projects.gitlab-ci.yml'
- '/templates/cache_cleanup.gitlab-ci.yml'
- '/templates/docker_image_jobs.gitlab-ci.yml'
prepare_hived_image:
extends: .prepare_hived_image
stage: build
variables:
REGISTRY_USER: "$HIVED_CI_IMGBUILDER_USER"
REGISTRY_PASS: $HIVED_CI_IMGBUILDER_PASSWORD
BINARY_CACHE_PATH: "$CI_PROJECT_DIR/hived-binaries"
HIVE_NETWORK_TYPE: mainnet
tags:
- public-runner-docker
- hived-for-tests
prepare_hived_data:
extends: .prepare_hived_data_5m
needs:
- job: prepare_hived_image
artifacts: true
stage: build
variables:
HIVE_NETWORK_TYPE: mainnet
BLOCK_LOG_SOURCE_DIR: $BLOCK_LOG_SOURCE_DIR_5M
CONFIG_INI_SOURCE: "$CI_PROJECT_DIR/docker/config_5M.ini"
tags:
- data-cache-storage
cleanup_hived_cache_manual:
extends: .cleanup_cache_manual_template
stage: cleanup
variables:
CLEANUP_PATH_PATTERN: "/cache/replay_data_hive_*"
tags:
- data-cache-storage
cleanup_cache_on_hived_builders:
extends: .cleanup_cache_manual_template
stage: cleanup
variables:
CLEANUP_PATH_PATTERN: "/cache/replay_data_hive_*"
tags:
- public-runner-docker
- hived-for-tests
cleanup_old_hived_cache:
extends: .cleanup_old_cache_template
stage: cleanup
variables:
CLEANUP_PATH_PATTERN: "/cache/replay_data_hive_*"
tags:
- data-cache-storage
testnet_node_build:
extends: .prepare_hived_image
stage: build
variables:
REGISTRY_USER: "$HIVED_CI_IMGBUILDER_USER"
REGISTRY_PASS: $HIVED_CI_IMGBUILDER_PASSWORD
BINARY_CACHE_PATH: "$CI_PROJECT_DIR/hived-testnet-binaries"
HIVE_NETWORK_TYPE: testnet
artifacts:
paths:
- "$BINARY_CACHE_PATH"
tags:
- public-runner-docker
- hived-for-tests
beekeeper_wasm_build:
extends: .wasm_build_job_template
stage: build
variables:
SOURCE_DIR: "${CI_PROJECT_DIR}/programs/beekeeper/beekeeper_wasm/"
BINARIES_DIR: "${CI_PROJECT_DIR}/programs/beekeeper/beekeeper_wasm/build"
tags:
- public-runner-docker
beekeeper_tsc_build:
extends: .npm_build_template
stage: build
variables:
SOURCE_DIR: "${CI_PROJECT_DIR}/programs/beekeeper/beekeeper_wasm"
DIST_DIR: "${CI_PROJECT_DIR}/programs/beekeeper/beekeeper_wasm/dist"
NPM_PACKAGE_SCOPE: "@hiveio"
NPM_PACKAGE_NAME: "beekeeper"
needs:
- job: beekeeper_wasm_build
artifacts: true
tags:
- public-runner-docker
generate_beekeeper_docs:
stage: build
extends: .npm_process_built_package_tarball
variables:
SOURCE_DIR: "${CI_PROJECT_DIR}/programs/beekeeper/beekeeper_wasm"
DIST_DIR: "$CI_PROJECT_DIR/programs/beekeeper/beekeeper_wasm/dist"
PACKAGE_TGZ_PATH: "${BUILT_PACKAGE_PATH}"
script:
- scripts/generate_api_docs.sh "${CI_PROJECT_URL}/programs/beekeeper/beekeeper_wasm" "${CI_COMMIT_SHA}"
needs:
- job: beekeeper_wasm_build
artifacts: true
- job: beekeeper_tsc_build
artifacts: true
artifacts:
paths:
- "${DIST_DIR}/docs"
when: always
expire_in: 1 week
tags:
- public-runner-docker
push_to_wiki:
extends: .npm_push_doc_template
stage: build
needs:
- job: generate_beekeeper_docs
artifacts: true
variables:
SOURCE_DIR: "${CI_PROJECT_DIR}/programs/beekeeper/beekeeper_wasm"
WIKI_PUSH_TOKEN: "$BEEKEEPER_DOC_WIKI_PUSH_TOKEN"
DIST_DIR: "$CI_PROJECT_DIR/programs/beekeeper/beekeeper_wasm/dist"
# Since beekeeper shares repo with Hived, we can't overwrite Wiki home here
PROJECT_URL: "https://gitlab.syncad.com/hive/beekeeper-doc"
artifacts:
reports:
dotenv:
- "${SOURCE_DIR}/gen_doc.env" # contains URL to generated documentation pointed by `GEN_DOC_URL` variable
tags:
- public-runner-docker
supplement_documentation_url:
extends: .npm_process_built_package_tarball
stage: build
needs:
- job: beekeeper_wasm_build
artifacts: true
- job: beekeeper_tsc_build
artifacts: true
- job: push_to_wiki
artifacts: true
variables:
SOURCE_DIR: "${CI_PROJECT_DIR}/programs/beekeeper/beekeeper_wasm"
PACKAGE_TGZ_PATH: "${BUILT_PACKAGE_PATH}"
DIST_DIR: "$CI_PROJECT_DIR/programs/beekeeper/beekeeper_wasm/dist"
script:
- |
set -xe
scripts/generate_api_docs.sh "${CI_PROJECT_URL}/programs/beekeeper/beekeeper_wasm" "${CI_COMMIT_SHA}" "${GEN_DOC_URL}" tmp_doc
cd "${SOURCE_DIR}"
npm pack --pack-destination "${DIST_DIR}" --json > "${DIST_DIR}/built_package_info.json" # repack to include updated README in final package
BUILT_PACKAGE_NAME=$(jq -r .[].filename "${DIST_DIR}/built_package_info.json")
echo BUILT_PACKAGE_PATH="${DIST_DIR}/${BUILT_PACKAGE_NAME}" > ${CI_PROJECT_DIR}/built_package_info.env
artifacts:
reports:
dotenv:
- "built_package_info.env" # contains path to produced tgz
paths:
- "${DIST_DIR}/*.tgz" # Built package
when: always
expire_in: 1 week
tags:
- public-runner-docker
mirrornet_node_build:
stage: build
extends: .prepare_hived_image
variables:
REGISTRY_USER: "$HIVED_CI_IMGBUILDER_USER"
REGISTRY_PASS: $HIVED_CI_IMGBUILDER_PASSWORD
BINARY_CACHE_PATH: "$CI_PROJECT_DIR/hived-mirrornet-binaries"
HIVE_NETWORK_TYPE: mirrornet
after_script:
- |
source docker_image_name.env
echo "Pushing hived image for commits on develop, master and tagged"
docker images
IMAGE_NAME_PREFIX="$CI_REGISTRY_IMAGE/mirrornet-instance:"
if [[ "$CI_COMMIT_BRANCH" == "develop" ]];
then
docker tag $HIVED_IMAGE_NAME_INSTANCE ${IMAGE_NAME_PREFIX}latest
docker push ${IMAGE_NAME_PREFIX}latest
elif [[ "$CI_COMMIT_BRANCH" == "master" ]];
then
docker tag $HIVED_IMAGE_NAME_INSTANCE ${IMAGE_NAME_PREFIX}stable
docker push ${IMAGE_NAME_PREFIX}stable
elif [[ -n "$CI_COMMIT_TAG" ]];
then
docker tag $HIVED_IMAGE_NAME_INSTANCE ${IMAGE_NAME_PREFIX}${CI_COMMIT_TAG}
docker push ${IMAGE_NAME_PREFIX}${CI_COMMIT_TAG}
fi
tags:
- public-runner-docker
- hived-for-tests
extended_block_log_creation:
extends: .extended_block_log_creation
stage: build
needs:
- job: "mirrornet_node_build"
artifacts: true
variables:
REGISTRY: "${CI_REGISTRY_IMAGE}"
IMAGE_TAG: ${CI_COMMIT_SHORT_SHA}
HIVE_SRC: ${CI_PROJECT_DIR}
BLOCK_LOG_SOURCE_DIR: "/blockchain/block_log_5m"
BINARY_PATH: "${CI_PROJECT_DIR}/hived-mirrornet-binaries"
rules:
- if: $CI_COMMIT_TAG
when: never
- if: $CI_COMMIT_BRANCH == "master"
when: never
- if: $CI_COMMIT_BRANCH
changes:
paths:
- scripts/ci-helpers/extended_block_log_creation.gitlab-ci.yml
- scripts/ci-helpers/prepare_extendend_mirrornet_block_log.sh
- tests/python/functional/util/block_logs_for_denser/generate_block_log_for_denser.py
when: always
- when: never
tags:
- public-runner-docker
- hived-for-tests
test_beekeeper_wasm:
extends: .npm_test_template
needs:
- job: beekeeper_wasm_build
artifacts: true
- job: beekeeper_tsc_build
artifacts: true
variables:
SOURCE_DIR: "programs/beekeeper/beekeeper_wasm"
PACKAGE_TGZ_PATH: "${BUILT_PACKAGE_PATH}"
tags:
- public-runner-docker
mirrornet_replay_test:
extends: .job-defaults
stage: test
image: "$CI_REGISTRY_IMAGE/ci-base-image$TEST_IMAGE_TAG"
needs:
- job: "mirrornet_node_build"
artifacts: true
variables:
BINARIES_DIR: "hived-mirrornet-binaries"
BLOCK_LOG_SOURCE_DIR: "/blockchain"
NUMBER_OF_BLOCKS: 5000000
MIRRORNET_WORKING_DIR: "$CI_PROJECT_DIR/mirrornet"
MIRRORNET_BLOCKCHAIN_DATA_DIR: "$MIRRORNET_WORKING_DIR/mirrornet_blockchain_data"
MIRRORNET_SOURCE_5M_DATA_DIR: "$MIRRORNET_WORKING_DIR/source_5m"
MAINNET_TRUNCATED_DIR: "$CI_PROJECT_DIR/mainnet"
CONFIG_INI_SOURCE: "$CI_PROJECT_DIR/docker/config_mirrornet_5M.ini"
before_script:
- export NUMBER_OF_PROCESSES=8
- mkdir -p "$MAINNET_TRUNCATED_DIR"
- mkdir -p "$MIRRORNET_SOURCE_5M_DATA_DIR"
- mkdir -p "$MIRRORNET_SOURCE_5M_DATA_DIR/blockchain"
- mkdir -p "$MIRRORNET_BLOCKCHAIN_DATA_DIR"
- mkdir -p "$MIRRORNET_BLOCKCHAIN_DATA_DIR/blockchain"
- cp "$CI_PROJECT_DIR/docker/config_mirrornet_5M.ini" "$MIRRORNET_WORKING_DIR/config.ini"
- cp "$BLOCK_LOG_SOURCE_DIR/block_log_5m/block_log" "$MIRRORNET_SOURCE_5M_DATA_DIR/blockchain"
- cd "$BINARIES_DIR"
script:
- echo "Generating artifacts file for block_log."
- time ./hived
--block-log-split=-1
-d "$MIRRORNET_SOURCE_5M_DATA_DIR"
- echo "Compressing block log to $NUMBER_OF_BLOCKS blocks with $NUMBER_OF_PROCESSES processes"
- time ./compress_block_log
-i "$MIRRORNET_SOURCE_5M_DATA_DIR/blockchain/block_log"
-o "$MAINNET_TRUNCATED_DIR/block_log"
--decompress
-n $NUMBER_OF_BLOCKS
--jobs $NUMBER_OF_PROCESSES
- echo "Converting block log to mirrornet format with $NUMBER_OF_PROCESSES processes"
- time ./blockchain_converter
--plugin block_log_conversion
-i "$MAINNET_TRUNCATED_DIR/block_log"
-o "$MIRRORNET_BLOCKCHAIN_DATA_DIR/blockchain/block_log"
--chain-id $MIRRORNET_CHAIN_ID
--private-key "$MIRRORNET_SKELETON_KEY"
--use-same-key
--jobs $NUMBER_OF_PROCESSES
- echo "Starting hived replay"
- ./hived
--block-log-split=-1
-d "$MIRRORNET_BLOCKCHAIN_DATA_DIR"
--chain-id $MIRRORNET_CHAIN_ID
--skeleton-key "$MIRRORNET_SKELETON_KEY"
--set-benchmark-interval 100000
--force-replay
--validate-during-replay
--stop-at-block $NUMBER_OF_BLOCKS
--exit-before-sync | tee hived-replay.log
artifacts:
paths:
- "$BINARIES_DIR/*.log"
tags:
- public-runner-docker
- hived-for-tests
.unit_tests_base:
extends: .job-defaults
stage: test
needs:
- job: testnet_node_build
artifacts: true
image: "$CI_REGISTRY_IMAGE/ci-base-image$TEST_IMAGE_TAG"
variables:
GIT_STRATEGY: none
FF_NETWORK_PER_BUILD: "true"
tags:
- public-runner-docker
chain_test:
extends: .unit_tests_base
script:
- timeout 23m ./hived-testnet-binaries/chain_test --log_format=JUNIT --log_sink=chain_test_results.xml --log_level=error > chain_test.log 2>&1
artifacts:
reports:
junit: chain_test_results.xml
paths:
- chain_test.log
when: always
expire_in: 1 week
plugin_test:
extends: .unit_tests_base
script:
# note: consider using --result_code=no to force exit code 0 even when tests fail because they currently fail and I want a nice green checkmark
- timeout 16m ./hived-testnet-binaries/plugin_test --log_format=JUNIT --log_sink=plugin_test_results.xml --log_level=error > plugin_test.log 2>&1
artifacts:
reports:
junit: plugin_test_results.xml
paths:
- plugin_test.log
when: always
expire_in: 1 week
.hived-service: &hived-service
- name: $HIVED_IMAGE_NAME
alias: hived-instance
variables:
DATA_SOURCE: "${DATA_CACHE_HIVE_PREFIX}_${HIVED_COMMIT}"
LOG_FILE: $CI_JOB_NAME.log
command: ["--replay-blockchain", "--stop-at-block=5000000"]
.test-block-log-service: &test-block-log-service
- name: $TESTING_BLOCK_LOG_LATEST_VERSION_IMAGE
alias: test-block-log-server
.universal-block-log-service: &universal-block-log-service
- name: $UNIVERSAL_BLOCK_LOG_LATEST_VERSION_IMAGE
alias: universal-block-log-server
.python_based:
image: "$CI_REGISTRY_IMAGE/ci-base-image$TEST_IMAGE_TAG"
extends:
- .project_develop_configuration_template
before_script:
- cd $CI_PROJECT_DIR/tests/python/hive-local-tools
- !reference [.project_develop_configuration_template, before_script]
- cd $CI_PROJECT_DIR
verify_poetry_lock_sanity:
extends: .verify_poetry_lock_sanity_template
stage: static_code_analysis
variables:
PYPROJECT_DIR: "$CI_PROJECT_DIR/tests/python/hive-local-tools"
tags:
- public-runner-docker
.python_static_analysis_configuration:
extends: .python_based
needs: [] # to run immediately without waiting for previous jobs
variables:
PACKAGES_TO_CHECK: "$CI_PROJECT_DIR/tests/python/"
PYPROJECT_CONFIG_PATH: "$CI_PROJECT_DIR/tests/python/hive-local-tools/pyproject.toml"
PRE_COMMIT_CONFIG: "$CI_PROJECT_DIR/tests/python/hive-local-tools/.pre-commit-config.yaml"
before_script:
- !reference [.python_based, before_script]
- cd $CI_PROJECT_DIR/tests/python/hive-local-tools
tags:
- public-runner-docker
pre_commit_checks:
stage: static_code_analysis
extends:
- .pre_commit_checks_template
- .python_static_analysis_configuration
artifacts:
paths:
- tests/python/hive-local-tools/poetry.lock
lint_code_with_ruff:
stage: static_code_analysis
extends:
- .lint_code_with_ruff_template
- .python_static_analysis_configuration
formatting_with_black_check:
stage: static_code_analysis
extends:
- .formatting_with_black_check_template
- .python_static_analysis_configuration
.pytest_based:
extends: .python_based
after_script:
- |
shopt -s globstar
tar --exclude='**/generated_during_*/**/block_log*' --exclude='**/generated_during_*/**/shared_memory.bin' --exclude='**/generated_during_*/**/*.sst' -cf - **/generated_during_* | 7z a -si generated_during.tar.7z
tar -cf - **/generated_by_package_fixtures | 7z a -si generated_by_package_fixtures.tar.7z
artifacts:
reports:
junit: $PYTEST_JUNIT_REPORT
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
paths:
- "generated_during.tar.7z"
- "generated_by_package_fixtures.tar.7z"
when: always
expire_in: 1 week
.test_tools_based:
extends: .pytest_based
variables:
HIVED_PATH: "$CI_PROJECT_DIR/hived-testnet-binaries/hived"
CLI_WALLET_PATH: "$CI_PROJECT_DIR/hived-testnet-binaries/cli_wallet"
GET_DEV_KEY_PATH: "$CI_PROJECT_DIR/hived-testnet-binaries/get_dev_key"
BLOCK_LOG_UTIL_PATH: "$CI_PROJECT_DIR/hived-testnet-binaries/block_log_util"
SST_DUMP_PATH: "$CI_PROJECT_DIR/hived-testnet-binaries/sst_dump"
TEST_TOOLS_NODE_DEFAULT_WAIT_FOR_LIVE_TIMEOUT: "60"
needs:
- job: testnet_node_build
artifacts: true
.beem_tests_base:
stage: test
extends: .test_tools_based
script:
- git clone --depth=1 --single-branch --branch master https://gitlab.syncad.com/hive/beem.git
- pip3 install junit-xml==${PYTHON_JUNIT_XML_VERSION} python-dateutil==${PYTHON_DATEUTIL_VERSION}
- cd beem
- python3 -m pip install .[tests]
- python3 setup.py install
- cd ..
- mkdir -p build/tests/hive-node-data
- cd tests/python/functional/beem_tests
- !reference [.run-pytest, script]
tags:
- public-runner-docker
beem_testnet_tests:
extends: .beem_tests_base
needs:
- job: testnet_node_build
artifacts: true
variables:
PYTEST_TIMEOUT_MINUTES: 18
PYTEST_ARGS: "-m not mirrornet"
PYTEST_JUNIT_REPORT: $CI_PROJECT_DIR/tests/python/functional/beem_tests/report.xml
beem_mirrornet_tests:
extends: .beem_tests_base
needs:
- job: mirrornet_node_build
artifacts: true
variables:
PYTEST_TIMEOUT_MINUTES: 4
HIVED_PATH: "$CI_PROJECT_DIR/hived-mirrornet-binaries/hived"
CLI_WALLET_PATH: "$CI_PROJECT_DIR/hived-mirrornet-binaries/cli_wallet"
GET_DEV_KEY_PATH: "$CI_PROJECT_DIR/hived-mirrornet-binaries/get_dev_key"
BLOCK_LOG_UTIL_PATH: "$CI_PROJECT_DIR/hived-mirrornet-binaries/block_log_util"
PYTEST_JUNIT_REPORT: $CI_PROJECT_DIR/tests/python/functional/beem_tests/report.xml
before_script:
- !reference [.beem_tests_base, before_script]
- export PYTEST_ARGS=(-m mirrornet --chain-id ${MIRRORNET_CHAIN_ID} --skeleton-key "${MIRRORNET_SKELETON_KEY}")
cli_wallet_tests:
stage: test
extends: .test_tools_based
variables:
PYTEST_JUNIT_REPORT: $CI_PROJECT_DIR/tests/python/functional/cli_wallet/report.xml
PYTEST_TIMEOUT_MINUTES: 30
script:
- cd tests/python/functional/cli_wallet
- !reference [.run-pytest, script]
tags:
- public-runner-docker
beekeeper_wallet_tests:
stage: test
extends: .test_tools_based
variables:
JUNIT_REPORT: $CI_PROJECT_DIR/tests/python/functional/beekeeper_wallet/report.xml
PYTEST_TIMEOUT_MINUTES: 30
script:
- cd tests/python/functional/beekeeper_wallet_tests
- !reference [.run-pytest, script]
tags:
- public-runner-docker
hived_tests:
stage: test
extends: .test_tools_based
variables:
PYTEST_JUNIT_REPORT: $CI_PROJECT_DIR/tests/python/functional/hived/report.xml
PYTEST_TIMEOUT_MINUTES: 30
script:
- cd tests/python/functional/hived
- !reference [.run-pytest, script]
tags:
- public-runner-docker
cli_wallet_extended_tests:
stage: test
extends: .test_tools_based
variables:
PYTEST_TIMEOUT_MINUTES: 14
PYTEST_JUNIT_REPORT: $CI_PROJECT_DIR/tests/python/functional/cli_wallet_extended_tests/report.xml
script:
- cd tests/python/functional/cli_wallet_extended_tests
- !reference [.run-pytest, script]
tags:
- public-runner-docker
.fork_test_base:
stage: test
extends: .test_tools_based
variables:
PYTEST_TIMEOUT_MINUTES: 20
PYTEST_NUMBER_OF_PROCESSES: 3
script:
- cd tests/python/functional/fork_tests
- !reference [.run-pytest, script]
tags:
- public-runner-docker
artifacts:
expire_in: 2 days
fork_tests_1_of_3:
extends: .fork_test_base
variables:
PYTEST_ARGS: "-m fork_tests_group_1"
PYTEST_JUNIT_REPORT: $CI_PROJECT_DIR/tests/python/functional/fork_tests/report_group_1.xml
fork_tests_2_of_3:
extends: .fork_test_base
variables:
PYTEST_ARGS: "-m fork_tests_group_2"
PYTEST_JUNIT_REPORT: $CI_PROJECT_DIR/tests/python/functional/fork_tests/report_group_2.xml
fork_tests_3_of_3:
extends: .fork_test_base
variables:
PYTEST_ARGS: "-m fork_tests_group_3"
PYTEST_JUNIT_REPORT: $CI_PROJECT_DIR/tests/python/functional/fork_tests/report_group_3.xml
hf26_tests:
stage: test
extends: .test_tools_based
variables:
PYTEST_TIMEOUT_MINUTES: 20
SIGN_TRANSACTION_PATH: "$CI_PROJECT_DIR/hived-testnet-binaries/sign_transaction"
PYTEST_JUNIT_REPORT: $CI_PROJECT_DIR/tests/python/functional/hf26_tests/report.xml
script:
- cd tests/python/functional/hf26_tests
- !reference [.run-pytest, script]
tags:
- public-runner-docker
live_sync_tests:
stage: test
extends: .test_tools_based
variables:
PYTEST_TIMEOUT_MINUTES: 10
PYTEST_JUNIT_REPORT: $CI_PROJECT_DIR/tests/python/functional/live_sync_tests/report.xml
script:
- cd tests/python/functional/live_sync_tests
- !reference [.run-pytest, script]
tags:
- public-runner-docker
broadcast_tests:
stage: test
extends: .test_tools_based
variables:
PYTEST_TIMEOUT_MINUTES: 6
PYTEST_JUNIT_REPORT: $CI_PROJECT_DIR/tests/python/functional/broadcast_tests/report.xml
script:
- cd tests/python/functional/broadcast_tests
- !reference [.run-pytest, script]
tags:
- public-runner-docker
test_tools_tests:
stage: test
extends: .test_tools_based
needs:
- !reference [.test_tools_based, needs]
- job: generate_testing_block_logs_and_save_image
variables:
NODE_ADDRESS: "test-block-log-server:80"
PYTEST_TIMEOUT_MINUTES: 30
PYTEST_JUNIT_REPORT: $CI_PROJECT_DIR/tests/python/hive-local-tools/test-tools/tests/report.xml
TESTING_BLOCK_LOGS_DESTINATION: $CI_PROJECT_DIR/tests/python/hive-local-tools/test-tools/tests
services:
- *test-block-log-service
script:
- test -n "$TESTING_BLOCK_LOG_LATEST_VERSION_IMAGE"
- curl -I ${NODE_ADDRESS} || (echo "error connecting to service test-block-log-server" && false)
- wget -nH -np -P $TESTING_BLOCK_LOGS_DESTINATION -r -R "index.html*" --cut-dirs=1 test-block-log-server:80/testing_block_logs/
- cd $CI_PROJECT_DIR/tests/python/hive-local-tools/test-tools/tests
- pip install local-tools/
- !reference [.run-pytest, script]
tags:
- public-runner-docker
rc_direct_delegations_tests:
stage: test
extends: .test_tools_based
variables:
PYTEST_TIMEOUT_MINUTES: 12
PYTEST_JUNIT_REPORT: $CI_PROJECT_DIR/tests/python/functional/direct_rc_delegations_tests/report.xml
script:
- cd tests/python/functional/direct_rc_delegations_tests
- !reference [.run-pytest, script]
tags:
- public-runner-docker
message_format_testnet_tests:
stage: test
extends: .test_tools_based
variables:
PYTEST_TIMEOUT_MINUTES: 25
NODE_TYPE: "testnet"
PYTEST_JUNIT_REPORT: $CI_PROJECT_DIR/tests/python/api_tests/message_format_tests/report.xml
script:
- cd tests/python/api_tests/message_format_tests/$API
- export PYTEST_ARGS=(-m "${NODE_TYPE} or (not testnet and not mainnet_5m and not live_mainnet)")
- !reference [.run-pytest, script]
parallel:
matrix:
- API: [ account_by_key_api_tests,
account_history_api,
block_api_tests,
condenser_api_tests,
database_api_tests,
debug_node_api_tests,
json_rpc_api_tests,
market_history_api_tests,
network_broadcast_api_tests,
rc_api_tests,
reputation_api_tests,
transaction_status_api_tests,
wallet_bridge_api_tests ]
tags:
- public-runner-docker
datagen_api_tests:
stage: test
extends: .test_tools_based
variables:
PYTEST_TIMEOUT_MINUTES: 25
SIGN_TRANSACTION_PATH: "$CI_PROJECT_DIR/hived-testnet-binaries/sign_transaction"
PYTEST_JUNIT_REPORT: $CI_PROJECT_DIR/tests/python/functional/datagen_tests/report.xml
script:
- cd tests/python/functional/datagen_tests/
- !reference [.run-pytest, script]
tags:
- public-runner-docker
patterns_tests:
stage: test
image: "$CI_REGISTRY_IMAGE/ci-base-image$TEST_IMAGE_TAG"
extends: .pytest_based
variables:
FF_NETWORK_PER_BUILD: 1
TEST_SUITE: "(condenser_api_patterns and (get_block or get_block_header) ) or block_api_patterns or (not get_transaction_hex and (get_transaction or get_account_history or enum_virtual_ops or get_ops_in_block))"
HIVED_UID: $HIVED_UID
HIVED_COMMIT: $HIVED_COMMIT # HIVED_COMMIT and HIVED_UID must be in this section to be passed to service
needs:
- job: prepare_hived_data
artifacts: true
services:
- *hived-service
before_script:
- curl -I hived-instance:8091 || (echo "error connecting to service hived-instance" && false)
- !reference [.test_tools_based, before_script]
script:
# run pattern tests
- cd $CI_PROJECT_DIR/tests/python/api_tests/pattern_tests
- timeout 33m ./run_tests.sh hived-instance:8091 "$CI_PROJECT_DIR" "${TEST_SUITE}" FALSE
artifacts:
reports:
junit: tests/python/api_tests/pattern_tests/results.xml
paths:
- "**/from_node.log"
- "**/ah.log"
- "**/*.out.json"
- "$CI_PROJECT_DIR/tests/python/hive-local-tools/tests-api/hived/workdir_*"
when: always
tags:
- data-cache-storage
transaction_serialization_testnet_tests:
stage: test
extends: .test_tools_based
variables:
PYTEST_TIMEOUT_MINUTES: 15
PYTEST_JUNIT_REPORT: $CI_PROJECT_DIR/tests/python/functional/transaction_serialization_tests/report.xml
script:
- cd $CI_PROJECT_DIR/tests/python/functional/transaction_serialization_tests
- export PYTEST_ARGS=(-m testnet)
- !reference [.run-pytest, script]
tags:
- public-runner-docker
python_pattern_mainnet_tests:
stage: test
image: "$CI_REGISTRY_IMAGE/ci-base-image$TEST_IMAGE_TAG"
extends: .test_tools_based
variables:
PYTEST_TIMEOUT_MINUTES: 27
TEST_TOOLS_NODE_DEFAULT_WAIT_FOR_LIVE_TIMEOUT: "60"
PYTEST_JUNIT_REPORT: $CI_PROJECT_DIR/tests/python/api_tests/python_patterns_tests/report.xml
BINARY_CACHE_PATH: "hived-binaries"
HIVED_UID: $HIVED_UID
HIVED_COMMIT: $HIVED_COMMIT
needs:
- job: prepare_hived_image
artifacts: true
- job: prepare_hived_data
artifacts: true
services:
- *hived-service
before_script:
- curl -I hived-instance:8091 || (echo "error connecting to service hived-instance" && false)
- !reference [.test_tools_based, before_script]
script:
# run pattern tests
- cd $CI_PROJECT_DIR/tests/python/api_tests/python_patterns_tests
- export PYTEST_ARGS=(-m mainnet_5m --http-endpoint hived-instance:8091 --ws-endpoint hived-instance:8090 --wallet-path $CI_PROJECT_DIR/$BINARY_CACHE_PATH/cli_wallet)
- !reference [.run-pytest, script]
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
reports:
junit: $CI_PROJECT_DIR/tests/python/api_tests/python_patterns_tests/report.xml
paths:
- "**/generated_during_*"
- "**/generated_by_package_fixtures"
exclude:
- "**/generated_during_*/**/block_log*"
- "**/generated_during_*/**/shared_memory.bin"
- "**/generated_during_*/**/*.sst"
when: always
tags:
- data-cache-storage
python_pattern_testnet_tests:
stage: test
extends: .test_tools_based
variables:
PYTEST_TIMEOUT_MINUTES: 10
PYTEST_JUNIT_REPORT: $CI_PROJECT_DIR/tests/python/api_tests/python_patterns_tests/report.xml
script:
- cd tests/python/api_tests/python_patterns_tests/
- export PYTEST_ARGS=(-m "not testnet and not mainnet_5m and not live_mainnet")
- !reference [.run-pytest, script]
tags:
- public-runner-docker
.message_format_tests:
stage: test
extends: .test_tools_based
variables:
PYTEST_TIMEOUT_MINUTES: 30
PYTEST_JUNIT_REPORT: $CI_PROJECT_DIR/tests/python/api_tests/message_format_tests/report.xml
script:
- cd tests/python/api_tests/message_format_tests/$API
- export PYTEST_ARGS=(-m ${NODE_TYPE} --http-endpoint=${NODE_ADDRESS})
- !reference [.run-pytest, script]
parallel:
matrix:
- API: [ account_by_key_api_tests,
account_history_api,
block_api_tests,
condenser_api_tests,
database_api_tests,
json_rpc_api_tests,
market_history_api_tests,
rc_api_tests,
reputation_api_tests,
transaction_status_api_tests,
wallet_bridge_api_tests ]
tags:
- public-runner-docker
- hived-for-tests
message_format_mainnet_5m_tests:
extends: .message_format_tests
needs:
- job: prepare_hived_data
artifacts: true
services:
- *hived-service
variables:
PYTEST_TIMEOUT_MINUTES: 10
NODE_ADDRESS: "hived-instance:8091"
NODE_TYPE: "mainnet_5m"
HIVED_UID: $HIVED_UID
HIVED_COMMIT: $HIVED_COMMIT
before_script:
- curl -I ${NODE_ADDRESS} || (echo "error connecting to service hived-instance" && false)
- !reference [.message_format_tests, before_script]
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
reports:
junit: $CI_PROJECT_DIR/tests/python/api_tests/message_format_tests/report.xml
paths:
- "**/generated_during_*"
- "**/generated_by_package_fixtures"
exclude:
- "**/generated_during_*/**/block_log*"
- "**/generated_during_*/**/shared_memory.bin"
- "**/generated_during_*/**/*.sst"
when: always
expire_in: 1 week
tags:
- data-cache-storage
message_format_live_mainnet_tests:
extends: .message_format_tests
variables:
NODE_ADDRESS: "http://api.fqdn.pl:8092"
NODE_TYPE: "live_mainnet"
rules:
# Run this job, only when environment variable "RUN_MESSAGE_FORMAT_TESTS_ON_LIVE_MAINNET" is set
- if: $RUN_MESSAGE_FORMAT_TESTS_ON_LIVE_MAINNET == "TRUE"
when: always
foundation_layer_tests:
stage: test
extends: .test_tools_based
variables:
PYTEST_TIMEOUT_MINUTES: 6
PYTEST_JUNIT_REPORT: $CI_PROJECT_DIR/tests/python/functional/foundation_layer_tests/report.xml
script:
- cd tests/python/functional/foundation_layer_tests
- !reference [.run-pytest, script]
tags:
- public-runner-docker
witness_tests:
stage: test
extends: .test_tools_based
needs:
- job: prepare_hived_data
artifacts: true
services:
- *hived-service
variables:
NODE_ADDRESS: "hived-instance:8091"
PYTEST_TIMEOUT_MINUTES: 5
PYTEST_JUNIT_REPORT: $CI_PROJECT_DIR/tests/python/functional/witness_tests/report.xml
HIVED_UID: $HIVED_UID
HIVED_COMMIT: $HIVED_COMMIT
script:
- curl -I ${NODE_ADDRESS} || (echo "error connecting to service hived-instance" && false)
- cd tests/python/functional/witness_tests
- export PYTEST_ARGS=(--http-endpoint=${NODE_ADDRESS})
- !reference [.run-pytest, script]
tags:
- data-cache-storage
hf28_tests:
stage: test
extends: .test_tools_based
variables:
PYTEST_TIMEOUT_MINUTES: 20
PYTEST_JUNIT_REPORT: $CI_PROJECT_DIR/tests/python/functional/hf28_tests/report.xml
script:
- cd tests/python/functional/hf28_tests
- !reference [.run-pytest, script]
tags:
- public-runner-docker
functional_api_tests: