forked from cypress-io/cypress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
1248 lines (1172 loc) · 35.4 KB
/
circle.yml
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
version: 2.1
# usually we don't build Mac app - it takes a long time
# but sometimes we want to really confirm we are doing the right thing
# so just add your branch to the list here to build and test on Mac
macBuildFilters: &macBuildFilters
filters:
branches:
only:
- develop
defaults: &defaults
parallelism: 1
working_directory: ~/cypress
parameters:
executor:
type: executor
default: cy-doc
executor: <<parameters.executor>>
environment:
## set specific timezone
TZ: "/usr/share/zoneinfo/America/New_York"
## store artifacts here
CIRCLE_ARTIFACTS: /tmp/artifacts
## set so that e2e tests are consistent
COLUMNS: 100
LINES: 24
executors:
# the Docker image with Cypress dependencies and Chrome browser
cy-doc:
docker:
- image: cypress/browsers:node12.8.1-chrome78-ff70
environment:
PLATFORM: linux
# Docker image with non-root "node" user
non-root-docker-user:
docker:
- image: cypress/base:12.0.0
user: node
environment:
PLATFORM: linux
# executor to run on Mac OS
# https://circleci.com/docs/2.0/executor-types/#using-macos
# https://circleci.com/docs/2.0/testing-ios/#supported-xcode-versions
mac:
macos:
xcode: "10.1.0"
environment:
PLATFORM: mac
commands:
run-e2e-tests:
parameters:
browser:
description: browser shortname to target
type: string
chunk:
description: e2e test chunk number
type: integer
steps:
- attach_workspace:
at: ~/
- run:
command: npm run test-e2e -- --chunk << parameters.chunk >> --browser << parameters.browser >>
working_directory: packages/server
- store_test_results:
path: /tmp/cypress
- store-npm-logs
store-npm-logs:
description: Saves any NPM debug logs as artifacts in case there is a problem
steps:
- store_artifacts:
path: ~/.npm/_logs
# for caching node modules use project environment variable
# like CACHE_VERSION=15
save-cache:
description: |
Shorter command to save node_modules for a package
Warning! Only works with "packages/<name>/node_modules"
parameters:
packageName:
description: Name of the package to save, for example "server" or "desktop-gui"
type: string
steps:
- save_cache:
name: Saving cache for << parameters.packageName >>
key: v{{ .Environment.CACHE_VERSION }}-{{ arch }}-{{ .Branch }}-deps-<< parameters.packageName >>-{{ checksum "packages/<< parameters.packageName >>/package.json" }}
paths:
- packages/<< parameters.packageName >>/node_modules
save-caches:
description: save each node_modules folder per package
steps:
# TODO switch to "save-cache" when it allows custom paths
- save_cache:
key: v{{ .Environment.CACHE_VERSION }}-{{ arch }}-{{ .Branch }}-deps-cli-{{ checksum "cli/package.json" }}
paths:
- cli/node_modules
- save_cache:
key: v{{ .Environment.CACHE_VERSION }}-{{ arch }}-{{ .Branch }}-deps-root-{{ checksum "package.json" }}
paths:
- node_modules
- save-cache:
packageName: coffee
- save-cache:
packageName: desktop-gui
- save-cache:
packageName: driver
- save-cache:
packageName: example
# TODO switch to "save-cache" custom command when it allows passing list of paths
- save_cache:
key: v{{ .Environment.CACHE_VERSION }}-{{ arch }}-{{ .Branch }}-deps-electron-{{ checksum "packages/electron/package.json" }}
paths:
- packages/electron/node_modules
- ~/.cache/electron
- ~/.electron
- save-cache:
packageName: extension
- save-cache:
packageName: https-proxy
- save-cache:
packageName: launcher
- save-cache:
packageName: network
- save-cache:
packageName: reporter
- save-cache:
packageName: runner
- save-cache:
packageName: server
- save-cache:
packageName: socket
- save-cache:
packageName: static
- save-cache:
packageName: ts
- save-cache:
packageName: web-config
restore-cache:
description: |
Shorter command to restore node_modules for a package.
Since it does not list paths to restore, can restore any cache,
as long the key is the same as the saved one.
parameters:
packageName:
description: Name of the package to restore, for example "server" or "desktop-gui"
type: string
packagePath:
description: Path to package.json file
type: string
steps:
- restore_cache:
name: Restoring cache for << parameters.packageName >>
key: v{{ .Environment.CACHE_VERSION }}-{{ arch }}-{{ .Branch }}-deps-<< parameters.packageName >>-{{ checksum "<< parameters.packagePath >>" }}
restore-caches:
description: need to restore a separate cache for each package.json
steps:
- restore-cache:
packageName: cli
packagePath: cli/package.json
- restore-cache:
packageName: root
packagePath: package.json
- restore-cache:
packageName: coffee
packagePath: packages/coffee/package.json
- restore-cache:
packageName: desktop-gui
packagePath: packages/desktop-gui/package.json
- restore-cache:
packageName: driver
packagePath: packages/driver/package.json
- restore-cache:
packageName: example
packagePath: packages/example/package.json
- restore-cache:
packageName: electron
packagePath: packages/electron/package.json
- restore-cache:
packageName: extension
packagePath: packages/extension/package.json
- restore-cache:
packageName: https-proxy
packagePath: packages/https-proxy/package.json
- restore-cache:
packageName: launcher
packagePath: packages/launcher/package.json
- restore-cache:
packageName: network
packagePath: packages/network/package.json
- restore-cache:
packageName: reporter
packagePath: packages/reporter/package.json
- restore-cache:
packageName: runner
packagePath: packages/runner/package.json
- restore-cache:
packageName: server
packagePath: packages/server/package.json
- restore-cache:
packageName: socket
packagePath: packages/socket/package.json
- restore-cache:
packageName: static
packagePath: packages/static/package.json
- restore-cache:
packageName: ts
packagePath: packages/ts/package.json
- restore-cache:
packageName: web-config
packagePath: packages/web-config/package.json
jobs:
## code checkout and NPM installs
build:
<<: *defaults
steps:
- checkout
- run:
name: Print working folder
command: echo $PWD
- run:
name: print global NPM cache path
command: echo $(npm -g bin)
- run:
name: print Node version
command: node -v
- run:
name: print NPM version
command: npm -v
- run: npm run check-node-version
## make sure the TERM is set to 'xterm' in node (Linux only)
## else colors (and tests) will fail
## See the following information
## * http://andykdocs.de/development/Docker/Fixing+the+Docker+TERM+variable+issue
## * https://unix.stackexchange.com/questions/43945/whats-the-difference-between-various-term-variables
- run: npm run check-terminal
- run: npm run stop-only-all
- restore-caches
# show what is already cached globally
- run: ls $(npm -g bin)
- run: ls $(npm -g bin)/../lib/node_modules
# Install the root packages
# Link sup packages in ./node_modules/@packages/*
# Install sub packages dependencies and build all sub packages via postinstall script
# try several times, because flaky NPM installs ...
- run: npm install || npm install
- run:
name: Top level packages
command: npm ls --depth=0 || true
# Prune so we do not save removed dependencies to cache
- run: npm run all prune
- save-caches
- store-npm-logs
## save entire folder as artifact for other jobs to run without reinstalling
- persist_to_workspace:
root: ~/
paths:
- cypress
lint:
<<: *defaults
steps:
- attach_workspace:
at: ~/
## this will catch .only's in js/coffee as well
- run: npm run lint-all
- store-npm-logs
unit-tests:
<<: *defaults
parallelism: 1
steps:
- attach_workspace:
at: ~/
# make sure mocha runs
- run: npm run test-mocha
# test binary build code
- run: npm run test-scripts
# make sure our snapshots are compared correctly
- run: npm run test-mocha-snapshot
# make sure packages with TypeScript can be transpiled to JS
- run: npm run all build-js
# test codemods
- run: npm run test-jscodeshift
# run unit tests from individual packages
- run: npm run all test -- --package cli
- run: npm run all test -- --package electron
- run: npm run all test -- --package extension
- run: npm run all test -- --package https-proxy
- run: npm run all test -- --package launcher
- run: npm run all test -- --package network
- run: npm run all test -- --package proxy
- run: npm run all test -- --package reporter
- run: npm run all test -- --package runner
- run: npm run all test -- --package socket
- run: npm run all test -- --package static
- store_test_results:
path: /tmp/cypress
- store-npm-logs
lint-types:
<<: *defaults
parallelism: 1
steps:
- attach_workspace:
at: ~/
- run:
command: ls -la types
working_directory: cli
- run:
command: ls -la chai
working_directory: cli/types
- run:
command: npm run dtslint
working_directory: cli
- store-npm-logs
"server-unit-tests":
<<: *defaults
parallelism: 2
steps:
- attach_workspace:
at: ~/
- run: npm run all test-unit -- --package server
- store_test_results:
path: /tmp/cypress
- store-npm-logs
"server-integration-tests":
<<: *defaults
parallelism: 2
steps:
- attach_workspace:
at: ~/
- run: npm run all test-integration -- --package server
- store_test_results:
path: /tmp/cypress
- store-npm-logs
"server-performance-tests":
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run:
command: npm run all test-performance -- --package server
- store_test_results:
path: /tmp/cypress
- store_artifacts:
path: /tmp/artifacts
- store-npm-logs
"server-e2e-tests-chrome-1":
<<: *defaults
steps:
- run-e2e-tests:
browser: chrome
chunk: 1
"server-e2e-tests-chrome-2":
<<: *defaults
steps:
- run-e2e-tests:
browser: chrome
chunk: 2
"server-e2e-tests-chrome-3":
<<: *defaults
steps:
- run-e2e-tests:
browser: chrome
chunk: 3
"server-e2e-tests-chrome-4":
<<: *defaults
steps:
- run-e2e-tests:
browser: chrome
chunk: 4
"server-e2e-tests-chrome-5":
<<: *defaults
steps:
- run-e2e-tests:
browser: chrome
chunk: 5
"server-e2e-tests-chrome-6":
<<: *defaults
steps:
- run-e2e-tests:
browser: chrome
chunk: 6
"server-e2e-tests-chrome-7":
<<: *defaults
steps:
- run-e2e-tests:
browser: chrome
chunk: 7
"server-e2e-tests-chrome-8":
<<: *defaults
steps:
- run-e2e-tests:
browser: chrome
chunk: 8
"server-e2e-tests-electron-1":
<<: *defaults
steps:
- run-e2e-tests:
browser: electron
chunk: 1
"server-e2e-tests-electron-2":
<<: *defaults
steps:
- run-e2e-tests:
browser: electron
chunk: 2
"server-e2e-tests-electron-3":
<<: *defaults
steps:
- run-e2e-tests:
browser: electron
chunk: 3
"server-e2e-tests-electron-4":
<<: *defaults
steps:
- run-e2e-tests:
browser: electron
chunk: 4
"server-e2e-tests-electron-5":
<<: *defaults
steps:
- run-e2e-tests:
browser: electron
chunk: 5
"server-e2e-tests-electron-6":
<<: *defaults
steps:
- run-e2e-tests:
browser: electron
chunk: 6
"server-e2e-tests-electron-7":
<<: *defaults
steps:
- run-e2e-tests:
browser: electron
chunk: 7
"server-e2e-tests-electron-8":
<<: *defaults
steps:
- run-e2e-tests:
browser: electron
chunk: 8
"driver-integration-tests-chrome":
<<: *defaults
parallelism: 5
steps:
- attach_workspace:
at: ~/
- run:
command: npm start
background: true
working_directory: packages/driver
- run:
command: $(npm bin)/wait-on http://localhost:3500
working_directory: packages/driver
- run:
command: |
CYPRESS_KONFIG_ENV=production \
CYPRESS_RECORD_KEY=$PACKAGES_RECORD_KEY \
npm run cypress:run -- --record --parallel --group 5x-driver-chrome --browser chrome
working_directory: packages/driver
- store_test_results:
path: /tmp/cypress
- store_artifacts:
path: /tmp/artifacts
- store-npm-logs
# "driver-integration-tests-electron":
# <<: *defaults
# parallelism: 5
# steps:
# - attach_workspace:
# at: ~/
# - run:
# command: npm start
# background: true
# working_directory: packages/driver
# - run:
# command: $(npm bin)/wait-on http://localhost:3500
# working_directory: packages/driver
# - run:
# command: |
# CYPRESS_KONFIG_ENV=production \
# CYPRESS_RECORD_KEY=$PACKAGES_RECORD_KEY \
# npm run cypress:run -- --record --parallel --group 5x-driver-electron --browser electron
# working_directory: packages/driver
# - store_test_results:
# path: /tmp/cypress
# - store_artifacts:
# path: /tmp/artifacts
# - store-npm-logs
"desktop-gui-integration-tests-2x":
<<: *defaults
parallelism: 2
steps:
- attach_workspace:
at: ~/
- run:
command: npm run build-prod
working_directory: packages/desktop-gui
- run:
command: |
CYPRESS_KONFIG_ENV=production \
CYPRESS_RECORD_KEY=$PACKAGES_RECORD_KEY \
npm run cypress:run -- --record --parallel --group 2x-desktop-gui
working_directory: packages/desktop-gui
- store_test_results:
path: /tmp/cypress
- store_artifacts:
path: /tmp/artifacts
- store-npm-logs
"reporter-integration-tests":
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run:
command: npm run build-prod
working_directory: packages/reporter
- run:
command: |
CYPRESS_KONFIG_ENV=production \
CYPRESS_RECORD_KEY=$PACKAGES_RECORD_KEY \
npm run cypress:run -- --record --parallel --group reporter
working_directory: packages/reporter
- store_test_results:
path: /tmp/cypress
- store_artifacts:
path: /tmp/artifacts
- store-npm-logs
"run-launcher":
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run:
command: node index.js
working_directory: packages/launcher
build-binary:
<<: *defaults
shell: /bin/bash --login
steps:
- run:
name: Check environment variables before code sign (if on Mac)
# NOTE
# our Mac code sign works via electron-builder
# by default, electron-builder will NOT sign app built in a pull request
# even our internal one (!)
# Usually this is not a problem, since we only build and test binary
# built on "develop" and "master" branches
# but if you need to really build and sign a Mac binary in a PR
# set variable CSC_FOR_PULL_REQUEST=true
command: |
set -e
if [[ "$OSTYPE" == "darwin"* ]]; then
if [ -z "$CSC_LINK" ]; then
echo "Need to provide environment variable CSC_LINK"
echo "with base64 encoded certificate .p12 file"
exit 1
fi
if [ -z "$CSC_KEY_PASSWORD" ]; then
echo "Need to provide environment variable CSC_KEY_PASSWORD"
echo "with password for unlocking certificate .p12 file"
exit 1
fi
else
echo "Not Mac platform, skipping code sign setup"
fi
- attach_workspace:
at: ~/
- run: $(npm bin)/print-arch
- run:
environment:
DEBUG: electron-builder,electron-osx-sign*
# if this is a forked pull request, the NEXT_DEV_VERSION environment variable
# won't be set and we will use default version, since we are not going to
# upload the dev binary build anywhere
command: npm run binary-build -- --platform $PLATFORM --version ${NEXT_DEV_VERSION:-0.0.0-development}
- run: npm run binary-zip -- --platform $PLATFORM
# Cypress binary file should be zipped to cypress.zip
- run: ls -l *.zip
- store-npm-logs
- persist_to_workspace:
root: ~/
paths:
- cypress/cypress.zip
upload-binary:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run: ls -l
- run:
name: upload unique binary
command: |
node scripts/binary.js upload-unique-binary \
--file cypress.zip \
--version $NEXT_DEV_VERSION
- run: cat binary-url.json
- store-npm-logs
- persist_to_workspace:
root: ~/
paths:
- cypress/binary-url.json
test-kitchensink:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run:
name: Cloning test project
command: git clone https://github.com/cypress-io/cypress-example-kitchensink.git /tmp/repo
- run:
name: Install prod dependencies
command: npm install --production
working_directory: /tmp/repo
- run:
name: Example server
command: npm start
working_directory: /tmp/repo
background: true
- run:
name: Run Kitchensink example project
command: npm run cypress:run -- --project /tmp/repo
- store_artifacts:
path: /tmp/repo/cypress/screenshots
- store_artifacts:
path: /tmp/repo/cypress/videos
- store-npm-logs
"test-kitchensink-against-staging":
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run:
name: Cloning test project
command: git clone https://github.com/cypress-io/cypress-example-kitchensink.git /tmp/repo
- run:
name: Install prod dependencies
command: npm install --production
working_directory: /tmp/repo
- run:
name: Example server
command: npm start
working_directory: /tmp/repo
background: true
- run:
name: Run Kitchensink example project
command: |
CYPRESS_PROJECT_ID=$TEST_KITCHENSINK_PROJECT_ID \
CYPRESS_RECORD_KEY=$TEST_KITCHENSINK_RECORD_KEY \
CYPRESS_ENV=staging \
CYPRESS_video=false \
npm run cypress:run -- --project /tmp/repo --record
- store-npm-logs
"test-against-staging":
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run:
name: Cloning test project
command: git clone https://github.com/cypress-io/cypress-test-tiny.git /tmp/repo
- run:
name: Run test project
command: |
CYPRESS_PROJECT_ID=$TEST_TINY_PROJECT_ID \
CYPRESS_RECORD_KEY=$TEST_TINY_RECORD_KEY \
CYPRESS_ENV=staging \
npm run cypress:run -- --project /tmp/repo --record
- store-npm-logs
build-npm-package:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run: npm run check-next-dev-version
- run:
name: bump NPM version
command: npm --no-git-tag-version --allow-same-version version ${NEXT_DEV_VERSION:-0.0.0-development}
- run:
name: build NPM package
working_directory: cli
command: npm run build
- run:
command: ls -la types
working_directory: cli/build
- run:
name: list NPM package contents
working_directory: cli/build
command: npm run size
- run:
name: pack NPM package
working_directory: cli/build
command: npm pack
- run:
name: list created NPM package
working_directory: cli/build
command: ls -l
# created file should have filename cypress-<version>.tgz
- run: mkdir /tmp/urls
- run: cp cli/build/cypress-${NEXT_DEV_VERSION:-0.0.0-development}.tgz cypress.tgz
- run: cp cli/build/cypress-${NEXT_DEV_VERSION:-0.0.0-development}.tgz /tmp/urls/cypress.tgz
- run: ls -l /tmp/urls
- store-npm-logs
- run: pwd
- run: ls -l
- persist_to_workspace:
root: ~/
paths:
- cypress/cypress.tgz
upload-npm-package:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run: ls -l
# NPM package file should have filename cypress-<version>.tgz
- run:
name: upload NPM package
command: |
node scripts/binary.js upload-npm-package \
--file cypress.tgz \
--version $NEXT_DEV_VERSION
- store-npm-logs
- run: ls -l
- run: cat npm-package-url.json
- persist_to_workspace:
root: ~/
paths:
- cypress/npm-package-url.json
"test-binary-and-npm-against-other-projects":
<<: *defaults
steps:
# needs uploaded NPM and test binary
- attach_workspace:
at: ~/
- run: ls -la
# make sure JSON files with uploaded urls are present
- run: ls -la binary-url.json npm-package-url.json
- run: cat binary-url.json
- run: cat npm-package-url.json
- run: mkdir /tmp/testing
- run:
name: create dummy package
working_directory: /tmp/testing
command: npm init -y
- run:
# install NPM from unique urls
name: Install Cypress
command: |
node scripts/test-unique-npm-and-binary.js \
--npm npm-package-url.json \
--binary binary-url.json \
--cwd /tmp/testing
- run:
name: Verify Cypress binary
working_directory: /tmp/testing
command: $(npm bin)/cypress verify
- run:
name: Post pre-release install comment
command: |
node scripts/add-install-comment.js \
--npm npm-package-url.json \
--binary binary-url.json
- run:
name: Running other test projects with new NPM package and binary
command: |
node scripts/test-other-projects.js \
--npm npm-package-url.json \
--binary binary-url.json \
--provider circle
- store-npm-logs
"test-npm-module-and-verify-binary":
<<: *defaults
steps:
- attach_workspace:
at: ~/
# make sure we have cypress.zip received
- run: ls -l
- run: ls -l cypress.zip cypress.tgz
- run: mkdir test-binary
- run:
name: Create new NPM package
working_directory: test-binary
command: npm init -y
- run:
# install NPM from built NPM package folder
name: Install Cypress
working_directory: test-binary
# force installing the freshly built binary
command: CYPRESS_INSTALL_BINARY=/root/cypress/cypress.zip npm i /root/cypress/cypress.tgz
- run:
name: Verify Cypress binary
working_directory: test-binary
command: $(npm bin)/cypress verify
- store-npm-logs
# install NPM + binary zip and run against staging API
"test-binary-against-staging":
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run: ls -l
# make sure we have the binary and NPM package
- run: ls -l cypress.zip cypress.tgz
- run:
name: Cloning test project
command: git clone https://github.com/cypress-io/cypress-test-tiny.git /tmp/cypress-test-tiny
- run:
name: Install Cypress
working_directory: /tmp/cypress-test-tiny
# force installing the freshly built binary
command: CYPRESS_INSTALL_BINARY=~/cypress/cypress.zip npm i ~/cypress/cypress.tgz
- run:
name: Run test project
working_directory: /tmp/cypress-test-tiny
command: |
CYPRESS_PROJECT_ID=$TEST_TINY_PROJECT_ID \
CYPRESS_RECORD_KEY=$TEST_TINY_RECORD_KEY \
CYPRESS_ENV=staging \
$(npm bin)/cypress run --record
- store-npm-logs
"test-binary-against-kitchensink":
<<: *defaults
steps:
- attach_workspace:
at: ~/
# make sure the binary and NPM package files are present
- run: ls -l
- run: ls -l cypress.zip cypress.tgz
- run:
name: Cloning kitchensink project
command: git clone --depth 1 https://github.com/cypress-io/cypress-example-kitchensink.git /tmp/kitchensink
- run:
command: npm install
working_directory: /tmp/kitchensink
- run:
name: Install Cypress
working_directory: /tmp/kitchensink
# force installing the freshly built binary
command: CYPRESS_INSTALL_BINARY=~/cypress/cypress.zip npm i ~/cypress/cypress.tgz
- run:
working_directory: /tmp/kitchensink
command: npm run build
- run:
working_directory: /tmp/kitchensink
command: npm start
background: true
- run:
working_directory: /tmp/kitchensink
command: npm run e2e
- store-npm-logs
test-binary-as-specific-user:
<<: *defaults
steps:
- attach_workspace:
at: ~/
# the user should be "node"
- run: whoami
- run: pwd
# prints the current user's effective user id
# for root it is 0
# for other users it is a positive integer
- run: node -e 'console.log(process.geteuid())'
# make sure the binary and NPM package files are present
- run: ls -l
- run: ls -l cypress.zip cypress.tgz
- run: mkdir test-binary
- run:
name: Create new NPM package
working_directory: test-binary
command: npm init -y
- run:
# install NPM from built NPM package folder
name: Install Cypress
working_directory: test-binary
# force installing the freshly built binary
command: CYPRESS_INSTALL_BINARY=~/cypress/cypress.zip npm i ~/cypress/cypress.tgz
- run:
name: Add Cypress demo
working_directory: test-binary
command: npx @bahmutov/cly init
- run:
name: Verify Cypress binary
working_directory: test-binary
command: DEBUG=cypress:cli $(npm bin)/cypress verify
- run:
name: Run Cypress binary
working_directory: test-binary
command: DEBUG=cypress:cli $(npm bin)/cypress run
- store-npm-logs
linux-workflow: &linux-workflow
jobs:
- build
- lint:
name: Linux lint
requires:
- build
- lint-types:
requires:
- build
# unit, integration and e2e tests
- unit-tests:
requires:
- build
- server-unit-tests:
requires:
- build
- server-integration-tests:
requires:
- build
- server-performance-tests:
context: test-runner:performance-tracking
requires:
- build
- server-e2e-tests-chrome-1:
context: test-runner:performance-tracking
requires:
- build
- server-e2e-tests-chrome-2:
context: test-runner:performance-tracking
requires:
- build
- server-e2e-tests-chrome-3:
context: test-runner:performance-tracking
requires:
- build
- server-e2e-tests-chrome-4:
context: test-runner:performance-tracking
requires:
- build
- server-e2e-tests-chrome-5:
context: test-runner:performance-tracking
requires:
- build
- server-e2e-tests-chrome-6:
context: test-runner:performance-tracking
requires:
- build
- server-e2e-tests-chrome-7: