Debian Codegraph @

lib/App/Yath/Command/projects.pm

raw
1 package App::Yath::Command::projects;
2 use strict;
3 use warnings;
4
5 our $VERSION = '1.000179';
6
7 use parent 'App::Yath::Command::test';
8 use Test2::Harness::Util::HashBase;
9
10 sub summary { "Run tests for multiple projects" }
11 sub cli_args { "[--] projects_dir [::] [arguments to test scripts]" }
12
13 sub description {
14 return <<" EOT";
15 This command will run all the tests for each project within a parent directory.
16 EOT
17 }
18
19 sub finder_args {(multi_project => 1)}
20
21 1;
22
23 __END__
24
25 =pod
26
27 =encoding UTF-8
28
29 =head1 NAME
30
31 App::Yath::Command::projects - Run tests for multiple projects
32
33 =head1 DESCRIPTION
34
35 This command will run all the tests for each project within a parent directory.
36
37
38 =head1 USAGE
39
40 $ yath [YATH OPTIONS] projects [COMMAND OPTIONS]
41
42 =head2 YATH OPTIONS
43
44 =head3 Developer
45
46 =over 4
47
48 =item --dev-lib
49
50 =item --dev-lib=lib
51
52 =item -D
53
54 =item -D=lib
55
56 =item -Dlib
57
58 =item --no-dev-lib
59
60 Add paths to @INC before loading ANYTHING. This is what you use if you are developing yath or yath plugins to make sure the yath script finds the local code instead of the installed versions of the same code. You can provide an argument (-Dfoo) to provide a custom path, or you can just use -D without and arg to add lib, blib/lib and blib/arch.
61
62 Can be specified multiple times
63
64
65 =back
66
67 =head3 Environment
68
69 =over 4
70
71 =item --persist-dir ARG
72
73 =item --persist-dir=ARG
74
75 =item --no-persist-dir
76
77 Where to find persistence files.
78
79
80 =item --persist-file ARG
81
82 =item --persist-file=ARG
83
84 =item --pfile ARG
85
86 =item --pfile=ARG
87
88 =item --no-persist-file
89
90 Where to find the persistence file. The default is /{system-tempdir}/project-yath-persist.json. If no project is specified then it will fall back to the current directory. If the current directory is not writable it will default to /tmp/yath-persist.json which limits you to one persistent runner on your system.
91
92
93 =item --project ARG
94
95 =item --project=ARG
96
97 =item --project-name ARG
98
99 =item --project-name=ARG
100
101 =item --no-project
102
103 This lets you provide a label for your current project/codebase. This is best used in a .yath.rc file. This is necessary for a persistent runner.
104
105
106 =back
107
108 =head3 Finder Options
109
110 =over 4
111
112 =item --finder MyFinder
113
114 =item --finder +Test2::Harness::Finder::MyFinder
115
116 =item --no-finder
117
118 Specify what Finder subclass to use when searching for files/processing the file list. Use the "+" prefix to specify a fully qualified namespace, otherwise Test2::Harness::Finder::XXX namespace is assumed.
119
120
121 =back
122
123 =head3 Help and Debugging
124
125 =over 4
126
127 =item --show-opts
128
129 =item --no-show-opts
130
131 Exit after showing what yath thinks your options mean
132
133
134 =item --version
135
136 =item -V
137
138 =item --no-version
139
140 Exit after showing a helpful usage message
141
142
143 =back
144
145 =head3 Plugins
146
147 =over 4
148
149 =item --no-scan-plugins
150
151 =item --no-no-scan-plugins
152
153 Normally yath scans for and loads all App::Yath::Plugin::* modules in order to bring in command-line options they may provide. This flag will disable that. This is useful if you have a naughty plugin that is loading other modules when it should not.
154
155
156 =item --plugins PLUGIN
157
158 =item --plugins +App::Yath::Plugin::PLUGIN
159
160 =item --plugins PLUGIN=arg1,arg2,...
161
162 =item --plugin PLUGIN
163
164 =item --plugin +App::Yath::Plugin::PLUGIN
165
166 =item --plugin PLUGIN=arg1,arg2,...
167
168 =item -pPLUGIN
169
170 =item --no-plugins
171
172 Load a yath plugin.
173
174 Can be specified multiple times
175
176
177 =back
178
179 =head2 COMMAND OPTIONS
180
181 =head3 Collector Options
182
183 =over 4
184
185 =item --max-open-jobs 18
186
187 =item --no-max-open-jobs
188
189 Maximum number of jobs a collector can process at a time, if more jobs are pending their output will be delayed until the earlier jobs have been processed. (Default: double the -j value)
190
191
192 =item --max-poll-events 1000
193
194 =item --no-max-poll-events
195
196 Maximum number of events to poll from a job before jumping to the next job. (Default: 1000)
197
198
199 =back
200
201 =head3 Cover Options
202
203 =over 4
204
205 =item --cover-aggregator ByTest
206
207 =item --cover-aggregator ByRun
208
209 =item --cover-aggregator +Custom::Aggregator
210
211 =item --cover-agg ByTest
212
213 =item --cover-agg ByRun
214
215 =item --cover-agg +Custom::Aggregator
216
217 =item --no-cover-aggregator
218
219 Choose a custom aggregator subclass
220
221
222 =item --cover-class ARG
223
224 =item --cover-class=ARG
225
226 =item --no-cover-class
227
228 Choose a Test2::Plugin::Cover subclass
229
230
231 =item --cover-dirs ARG
232
233 =item --cover-dirs=ARG
234
235 =item --cover-dir ARG
236
237 =item --cover-dir=ARG
238
239 =item --no-cover-dirs
240
241 NO DESCRIPTION - FIX ME
242
243 Can be specified multiple times
244
245
246 =item --cover-exclude-dirs ARG
247
248 =item --cover-exclude-dirs=ARG
249
250 =item --cover-exclude-dir ARG
251
252 =item --cover-exclude-dir=ARG
253
254 =item --no-cover-exclude-dirs
255
256 Directory to leave out of file coverage and coverage metrics, along with everything under it at any depth. May be specified multiple times. Wildcards are expanded when the option is parsed, so a pattern matching nothing excludes nothing. Values are word-split first, so a path containing whitespace must be quoted or backslash-escaped. A resolved path may not contain a comma.
257
258 Can be specified multiple times
259
260
261 =item --cover-exclude-private
262
263 =item --no-cover-exclude-private
264
265
266
267
268 =item --cover-files
269
270 =item --no-cover-files
271
272 Use Test2::Plugin::Cover to collect coverage data for what files are touched by what tests. Unlike Devel::Cover this has very little performance impact (About 4% difference)
273
274
275 =item --cover-from path/to/log.jsonl
276
277 =item --cover-from http://example.com/coverage
278
279 =item --cover-from path/to/coverage.jsonl
280
281 =item --no-cover-from
282
283 This can be a test log, a coverage dump (old style json or new jsonl format), or a url to any of the previous. Tests will not be run if the file/url is invalid.
284
285
286 =item --cover-from-type json
287
288 =item --cover-from-type jsonl
289
290 =item --cover-from-type log
291
292 =item --no-cover-from-type
293
294 File type for coverage source. Usually it can be detected, but when it cannot be you should specify. "json" is old style single-blob coverage data, "jsonl" is the new by-test style, "log" is a logfile from a previous run.
295
296
297 =item --cover-maybe-from path/to/log.jsonl
298
299 =item --cover-maybe-from http://example.com/coverage
300
301 =item --cover-maybe-from path/to/coverage.jsonl
302
303 =item --no-cover-maybe-from
304
305 This can be a test log, a coverage dump (old style json or new jsonl format), or a url to any of the previous. Tests will continue even if the coverage file/url is invalid.
306
307
308 =item --cover-maybe-from-type json
309
310 =item --cover-maybe-from-type jsonl
311
312 =item --cover-maybe-from-type log
313
314 =item --no-cover-maybe-from-type
315
316 Same as "from_type" but for "maybe_from". Defaults to "from_type" if that is specified, otherwise auto-detect
317
318
319 =item --cover-metrics
320
321 =item --no-cover-metrics
322
323
324
325
326 =item --cover-types ARG
327
328 =item --cover-types=ARG
329
330 =item --cover-type ARG
331
332 =item --cover-type=ARG
333
334 =item --no-cover-types
335
336 NO DESCRIPTION - FIX ME
337
338 Can be specified multiple times
339
340
341 =item --cover-write
342
343 =item --cover-write=coverage.jsonl
344
345 =item --cover-write=coverage.json
346
347 =item --no-cover-write
348
349 Create a json or jsonl file of all coverage data seen during the run (This implies --cover-files).
350
351
352 =back
353
354 =head3 Display Options
355
356 =over 4
357
358 =item --color
359
360 =item --no-color
361
362 Turn color on, default is true if STDOUT is a TTY.
363
364
365 =item --hide-runner-output
366
367 =item --no-hide-runner-output
368
369 Hide output from the runner, showing only test output. (See Also truncate_runner_output)
370
371
372 =item --no-final-table
373
374 =item --no-no-final-table
375
376 When printing final results, don't use table-style display
377
378
379 =item --no-wrap
380
381 =item --no-no-wrap
382
383 Do not do fancy text-wrapping, let the terminal handle it
384
385
386 =item --progress
387
388 =item --no-progress
389
390 Toggle progress indicators. On by default if STDOUT is a TTY. You can use --no-progress to disable the 'events seen' counter and buffered event pre-display
391
392
393 =item --quiet
394
395 =item -q
396
397 =item --no-quiet
398
399 Be very quiet.
400
401 Can be specified multiple times
402
403
404 =item --renderers +My::Renderer
405
406 =item --renderers Renderer=arg1,arg2,...
407
408 =item --renderer +My::Renderer
409
410 =item --renderer Renderer=arg1,arg2,...
411
412 =item --no-renderers
413
414 Specify renderers, (Default: "Formatter=Test2"). Use "+" to give a fully qualified module name. Without "+" "Test2::Harness::Renderer::" will be prepended to your argument.
415
416 Can be specified multiple times. If the same key is listed multiple times the value lists will be appended together.
417
418
419 =item --show-times
420
421 =item -T
422
423 =item --no-show-times
424
425 Show the timing data for each job
426
427
428 =item --term-width 80
429
430 =item --term-width 200
431
432 =item --term-size 80
433
434 =item --term-size 200
435
436 =item --no-term-width
437
438 Alternative to setting $TABLE_TERM_SIZE. Setting this will override the terminal width detection to the number of characters specified.
439
440
441 =item --truncate-runner-output
442
443 =item --no-truncate-runner-output
444
445 Only show runner output that was generated after the current command. This is only useful with a persistent runner.
446
447
448 =item --verbose
449
450 =item -v
451
452 =item --no-verbose
453
454 Be more verbose
455
456 Can be specified multiple times
457
458
459 =back
460
461 =head3 Finder Options
462
463 =over 4
464
465 =item --default-at-search ARG
466
467 =item --default-at-search=ARG
468
469 =item --no-default-at-search
470
471 Specify the default file/dir search when 'AUTHOR_TESTING' is set. Defaults to './xt'. The default AT search is only used if no files were specified at the command line
472
473 Can be specified multiple times
474
475
476 =item --default-search ARG
477
478 =item --default-search=ARG
479
480 =item --no-default-search
481
482 Specify the default file/dir search. defaults to './t', './t2', and 'test.pl'. The default search is only used if no files were specified at the command line
483
484 Can be specified multiple times
485
486
487 =item --durations file.json
488
489 =item --durations http://example.com/durations.json
490
491 =item --no-durations
492
493 Point at a json file or url which has a hash of relative test filenames as keys, and 'SHORT', 'MEDIUM', or 'LONG' as values. This will override durations listed in the file headers. An exception will be thrown if the durations file or url does not work.
494
495
496 =item --durations-threshold ARG
497
498 =item --durations-threshold=ARG
499
500 =item --Dt ARG
501
502 =item --Dt=ARG
503
504 =item --no-durations-threshold
505
506 Only fetch duration data if running at least this number of tests. Default (-j value + 1)
507
508
509 =item --exclude-file t/nope.t
510
511 =item --no-exclude-file
512
513 Exclude a file from testing
514
515 Can be specified multiple times
516
517
518 =item --exclude-list file.txt
519
520 =item --exclude-list http://example.com/exclusions.txt
521
522 =item --no-exclude-list
523
524 Point at a file or url which has a new line separated list of test file names to exclude from testing. Starting a line with a '#' will comment it out (for compatibility with Test2::Aggregate list files).
525
526 Can be specified multiple times
527
528
529 =item --exclude-pattern t/nope.t
530
531 =item --no-exclude-pattern
532
533 Exclude a pattern from testing, matched using m/$PATTERN/
534
535 Can be specified multiple times
536
537
538 =item --extension ARG
539
540 =item --extension=ARG
541
542 =item --ext ARG
543
544 =item --ext=ARG
545
546 =item --no-extension
547
548 Specify valid test filename extensions, default: t and t2
549
550 Can be specified multiple times
551
552
553 =item --maybe-durations file.json
554
555 =item --maybe-durations http://example.com/durations.json
556
557 =item --no-maybe-durations
558
559 Point at a json file or url which has a hash of relative test filenames as keys, and 'SHORT', 'MEDIUM', or 'LONG' as values. This will override durations listed in the file headers. An exception will be thrown if the durations file or url does not work.
560
561
562 =item --no-long
563
564 =item --no-no-long
565
566 Do not run tests that have their duration flag set to 'LONG'
567
568
569 =item --only-long
570
571 =item --no-only-long
572
573 Only run tests that have their duration flag set to 'LONG'
574
575
576 =item --rerun
577
578 =item --rerun=path/to/log.jsonl
579
580 =item --rerun=plugin_specific_string
581
582 =item --no-rerun
583
584 Re-Run tests from a previous run from a log file (or last log file). Plugins can intercept this, such as YathUIDB which will grab a run UUID and derive tests to re-run from that.
585
586
587 =item --rerun-all
588
589 =item --rerun-all=path/to/log.jsonl
590
591 =item --rerun-all=plugin_specific_string
592
593 =item --no-rerun-all
594
595 Re-Run all tests from a previous run from a log file (or last log file). Plugins can intercept this, such as YathUIDB which will grab a run UUID and derive tests to re-run from that.
596
597
598 =item --rerun-failed
599
600 =item --rerun-failed=path/to/log.jsonl
601
602 =item --rerun-failed=plugin_specific_string
603
604 =item --no-rerun-failed
605
606 Re-Run failed tests from a previous run from a log file (or last log file). Plugins can intercept this, such as YathUIDB which will grab a run UUID and derive tests to re-run from that.
607
608
609 =item --rerun-missed
610
611 =item --rerun-missed=path/to/log.jsonl
612
613 =item --rerun-missed=plugin_specific_string
614
615 =item --no-rerun-missed
616
617 Run missed tests from a previously aborted/stopped run from a log file (or last log file). Plugins can intercept this, such as YathUIDB which will grab a run UUID and derive tests to re-run from that.
618
619
620 =item --rerun-modes failed,missed,...
621
622 =item --rerun-modes all
623
624 =item --rerun-modes failed
625
626 =item --rerun-modes missed
627
628 =item --rerun-modes passed
629
630 =item --rerun-modes retried
631
632 =item --rerun-mode failed,missed,...
633
634 =item --rerun-mode all
635
636 =item --rerun-mode failed
637
638 =item --rerun-mode missed
639
640 =item --rerun-mode passed
641
642 =item --rerun-mode retried
643
644 =item --no-rerun-modes
645
646 Pick which test categories to run
647
648 Can be specified multiple times
649
650
651 =item --rerun-passed
652
653 =item --rerun-passed=path/to/log.jsonl
654
655 =item --rerun-passed=plugin_specific_string
656
657 =item --no-rerun-passed
658
659 Re-Run passed tests from a previous run from a log file (or last log file). Plugins can intercept this, such as YathUIDB which will grab a run UUID and derive tests to re-run from that.
660
661
662 =item --rerun-plugin Foo
663
664 =item --rerun-plugin +App::Yath::Plugin::Foo
665
666 =item --no-rerun-plugin
667
668 What plugin(s) should be used for rerun (will fallback to other plugins if the listed ones decline the value, this is just used to set an order of priority)
669
670 Can be specified multiple times
671
672
673 =item --rerun-retried
674
675 =item --rerun-retried=path/to/log.jsonl
676
677 =item --rerun-retried=plugin_specific_string
678
679 =item --no-rerun-retried
680
681 Re-Run retried tests from a previous run from a log file (or last log file). Plugins can intercept this, such as YathUIDB which will grab a run UUID and derive tests to re-run from that.
682
683
684 =item --search ARG
685
686 =item --search=ARG
687
688 =item --no-search
689
690 List of tests and test directories to use instead of the default search paths. Typically these can simply be listed as command line arguments without the --search prefix.
691
692 Can be specified multiple times
693
694
695 =back
696
697 =head3 Formatter Options
698
699 =over 4
700
701 =item --formatter ARG
702
703 =item --formatter=ARG
704
705 =item --no-formatter
706
707 NO DESCRIPTION - FIX ME
708
709
710 =item --qvf
711
712 =item --no-qvf
713
714 [Q]uiet, but [V]erbose on [F]ailure. Hide all output from tests when they pass, except to say they passed. If a test fails then ALL output from the test is verbosely output.
715
716
717 =item --show-job-end
718
719 =item --no-show-job-end
720
721 Show output when a job ends. (Default: on)
722
723
724 =item --show-job-info
725
726 =item --no-show-job-info
727
728 Show the job configuration when a job starts. (Default: off, unless -vv)
729
730
731 =item --show-job-launch
732
733 =item --no-show-job-launch
734
735 Show output for the start of a job. (Default: off unless -v)
736
737
738 =item --show-run-info
739
740 =item --no-show-run-info
741
742 Show the run configuration when a run starts. (Default: off, unless -vv)
743
744
745 =back
746
747 =head3 Git Options
748
749 =over 4
750
751 =item --git-change-base master
752
753 =item --git-change-base HEAD^
754
755 =item --git-change-base df22abe4
756
757 =item --no-git-change-base
758
759 Find files changed by all commits in the current branch from most recent stopping when a commit is found that is also present in the history of the branch/commit specified as the change base.
760
761
762 =back
763
764 =head3 Help and Debugging
765
766 =over 4
767
768 =item --dummy
769
770 =item -d
771
772 =item --no-dummy
773
774 Dummy run, do not actually execute anything
775
776 Can also be set with the following environment variables: C<T2_HARNESS_DUMMY>
777
778
779 =item --help
780
781 =item -h
782
783 =item --no-help
784
785 exit after showing help information
786
787
788 =item --interactive
789
790 =item -i
791
792 =item --no-interactive
793
794 Use interactive mode, 1 test at a time, stdin forwarded to it
795
796
797 =item --keep-dirs
798
799 =item --keep_dir
800
801 =item -k
802
803 =item --no-keep-dirs
804
805 Do not delete directories when done. This is useful if you want to inspect the directories used for various commands.
806
807
808 =item --procname-prefix ARG
809
810 =item --procname-prefix=ARG
811
812 =item --no-procname-prefix
813
814 Add a prefix to all proc names (as seen by ps).
815
816
817 =item --summary
818
819 =item --summary=/path/to/summary.json
820
821 =item --no-summary
822
823 Write out a summary json file, if no path is provided 'summary.json' will be used. The .json extension is added automatically if omitted.
824
825
826 =back
827
828 =head3 Logging Options
829
830 =over 4
831
832 =item --bzip2
833
834 =item --bz2
835
836 =item --bzip2_log
837
838 =item -B
839
840 =item --no-bzip2
841
842 Use bzip2 compression when writing the log. This option implies -L. The .bz2 prefix is added to log file name for you
843
844
845 =item --gzip
846
847 =item --gz
848
849 =item --gzip_log
850
851 =item -G
852
853 =item --no-gzip
854
855 Use gzip compression when writing the log. This option implies -L. The .gz prefix is added to log file name for you
856
857
858 =item --log
859
860 =item -L
861
862 =item --no-log
863
864 Turn on logging
865
866
867 =item --log-dir ARG
868
869 =item --log-dir=ARG
870
871 =item --no-log-dir
872
873 Specify a log directory. Will fall back to the system temp dir.
874
875
876 =item --log-file ARG
877
878 =item --log-file=ARG
879
880 =item -F ARG
881
882 =item -F=ARG
883
884 =item --no-log-file
885
886 Specify the name of the log file. This option implies -L.
887
888
889 =item --log-file-format ARG
890
891 =item --log-file-format=ARG
892
893 =item --lff ARG
894
895 =item --lff=ARG
896
897 =item --no-log-file-format
898
899 Specify the format for automatically-generated log files. Overridden by --log-file, if given. This option implies -L (Default: \$YATH_LOG_FILE_FORMAT, if that is set, or else "%!P%Y-%m-%d~%H:%M:%S~%!U~%!p.jsonl"). This is a string in which percent-escape sequences will be replaced as per POSIX::strftime. The following special escape sequences are also replaced: (%!P : Project name followed by a ~, if a project is defined, otherwise empty string) (%!U : the unique test run ID) (%!p : the process ID) (%!S : the number of seconds since local midnight UTC)
900
901 Can also be set with the following environment variables: C<YATH_LOG_FILE_FORMAT>, C<TEST2_HARNESS_LOG_FORMAT>
902
903
904 =back
905
906 =head3 Notification Options
907
908 =over 4
909
910 =item --notify-email [email protected]
911
912 =item --no-notify-email
913
914 Email the test results to the specified email address(es)
915
916 Can be specified multiple times
917
918
919 =item --notify-email-fail [email protected]
920
921 =item --no-notify-email-fail
922
923 Email failing results to the specified email address(es)
924
925 Can be specified multiple times
926
927
928 =item --notify-email-from [email protected]
929
930 =item --no-notify-email-from
931
932 If any email is sent, this is who it will be from
933
934
935 =item --notify-email-owner
936
937 =item --no-notify-email-owner
938
939 Email the owner of broken tests files upon failure. Add `# HARNESS-META-OWNER [email protected]` to the top of a test file to give it an owner
940
941
942 =item --notify-no-batch-email
943
944 =item --no-notify-no-batch-email
945
946 Usually owner failures are sent as a single batch at the end of testing. Toggle this to send failures as they happen.
947
948
949 =item --notify-no-batch-slack
950
951 =item --no-notify-no-batch-slack
952
953 Usually owner failures are sent as a single batch at the end of testing. Toggle this to send failures as they happen.
954
955
956 =item --notify-slack '#foo'
957
958 =item --notify-slack '@bar'
959
960 =item --no-notify-slack
961
962 Send results to a slack channel and/or user
963
964 Can be specified multiple times
965
966
967 =item --notify-slack-fail '#foo'
968
969 =item --notify-slack-fail '@bar'
970
971 =item --no-notify-slack-fail
972
973 Send failing results to a slack channel and/or user
974
975 Can be specified multiple times
976
977
978 =item --notify-slack-owner
979
980 =item --no-notify-slack-owner
981
982 Send slack notifications to the slack channels/users listed in test meta-data when tests fail.
983
984
985 =item --notify-slack-url https://hooks.slack.com/...
986
987 =item --no-notify-slack-url
988
989 Specify an API endpoint for slack webhook integrations
990
991
992 =item --notify-text ARG
993
994 =item --notify-text=ARG
995
996 =item --message ARG
997
998 =item --message=ARG
999
1000 =item --msg ARG
1001
1002 =item --msg=ARG
1003
1004 =item --no-notify-text
1005
1006 Add a custom text snippet to email/slack notifications
1007
1008
1009 =item --notify-text-module ARG
1010
1011 =item --notify-text-module=ARG
1012
1013 =item --message_module ARG
1014
1015 =item --message_module=ARG
1016
1017 =item --no-notify-text-module
1018
1019 Use the specified module to generate messages for emails and/or slack.
1020
1021
1022 =back
1023
1024 =head3 Run Options
1025
1026 =over 4
1027
1028 =item --author-testing
1029
1030 =item -A
1031
1032 =item --no-author-testing
1033
1034 This will set the AUTHOR_TESTING environment to true
1035
1036
1037 =item --dbi-profiling
1038
1039 =item --no-dbi-profiling
1040
1041 Use Test2::Plugin::DBIProfile to collect database profiling data
1042
1043
1044 =item --env-var VAR=VAL
1045
1046 =item -EVAR=VAL
1047
1048 =item -E VAR=VAL
1049
1050 =item --no-env-var
1051
1052 Set environment variables to set when each test is run.
1053
1054 Can be specified multiple times
1055
1056
1057 =item --event-uuids
1058
1059 =item --uuids
1060
1061 =item --no-event-uuids
1062
1063 Use Test2::Plugin::UUID inside tests (default: on)
1064
1065
1066 =item --fields name:details
1067
1068 =item --fields JSON_STRING
1069
1070 =item -f name:details
1071
1072 =item -f JSON_STRING
1073
1074 =item --no-fields
1075
1076 Add custom data to the harness run
1077
1078 Can be specified multiple times
1079
1080
1081 =item --input ARG
1082
1083 =item --input=ARG
1084
1085 =item --no-input
1086
1087 Input string to be used as standard input for ALL tests. See also: --input-file
1088
1089
1090 =item --input-file ARG
1091
1092 =item --input-file=ARG
1093
1094 =item --no-input-file
1095
1096 Use the specified file as standard input to ALL tests
1097
1098
1099 =item --io-events
1100
1101 =item --no-io-events
1102
1103 Use Test2::Plugin::IOEvents inside tests to turn all prints into test2 events (default: off)
1104
1105
1106 =item --link 'https://travis.work/builds/42'
1107
1108 =item --link 'https://jenkins.work/job/42'
1109
1110 =item --link 'https://buildbot.work/builders/foo/builds/42'
1111
1112 =item --no-link
1113
1114 Provide one or more links people can follow to see more about this run.
1115
1116 Can be specified multiple times
1117
1118
1119 =item --load ARG
1120
1121 =item --load=ARG
1122
1123 =item --load-module ARG
1124
1125 =item --load-module=ARG
1126
1127 =item -m ARG
1128
1129 =item -m=ARG
1130
1131 =item --no-load
1132
1133 Load a module in each test (after fork). The "import" method is not called.
1134
1135 Can be specified multiple times
1136
1137
1138 =item --load-import Module
1139
1140 =item --load-import Module=import_arg1,arg2,...
1141
1142 =item --loadim Module
1143
1144 =item --loadim Module=import_arg1,arg2,...
1145
1146 =item -M Module
1147
1148 =item -M Module=import_arg1,arg2,...
1149
1150 =item --no-load-import
1151
1152 Load a module in each test (after fork). Import is called.
1153
1154 Can be specified multiple times. If the same key is listed multiple times the value lists will be appended together.
1155
1156
1157 =item --mem-usage
1158
1159 =item --no-mem-usage
1160
1161 Use Test2::Plugin::MemUsage inside tests (default: on)
1162
1163
1164 =item --retry ARG
1165
1166 =item --retry=ARG
1167
1168 =item -r ARG
1169
1170 =item -r=ARG
1171
1172 =item --no-retry
1173
1174 Run any jobs that failed a second time. NOTE: --retry=1 means failing tests will be attempted twice!
1175
1176
1177 =item --retry-isolated
1178
1179 =item --retry-iso
1180
1181 =item --no-retry-isolated
1182
1183 If true then any job retries will be done in isolation (as though -j1 was set)
1184
1185
1186 =item --run-id
1187
1188 =item --id
1189
1190 =item --no-run-id
1191
1192 Set a specific run-id. (Default: a UUID)
1193
1194
1195 =item --test-args ARG
1196
1197 =item --test-args=ARG
1198
1199 =item --no-test-args
1200
1201 Arguments to pass in as @ARGV for all tests that are run. These can be provided easier using the '::' argument separator.
1202
1203 Can be specified multiple times
1204
1205
1206 =item --stream
1207
1208 =item --no-stream
1209
1210 Use the stream formatter (default is on)
1211
1212
1213 =item --tap
1214
1215 =item --TAP
1216
1217 =item ----no-stream
1218
1219 =item --no-tap
1220
1221 The TAP format is lossy and clunky. Test2::Harness normally uses a newer streaming format to receive test results. There are old/legacy tests where this causes problems, in which case setting --TAP or --no-stream can help.
1222
1223
1224 =back
1225
1226 =head3 Runner Options
1227
1228 =over 4
1229
1230 =item --abort-on-bail
1231
1232 =item --no-abort-on-bail
1233
1234 Abort all testing if a bail-out is encountered (default: on)
1235
1236
1237 =item --blib
1238
1239 =item -b
1240
1241 =item --no-blib
1242
1243 (Default: include if it exists) Include 'blib/lib' and 'blib/arch' in your module path
1244
1245
1246 =item --cover
1247
1248 =item --cover=-silent,1,+ignore,^t/,+ignore,^t2/,+ignore,^xt,+ignore,^test.pl
1249
1250 =item --no-cover
1251
1252 Use Devel::Cover to calculate test coverage. This disables forking. If no args are specified the following are used: -silent,1,+ignore,^t/,+ignore,^t2/,+ignore,^xt,+ignore,^test.pl
1253
1254
1255 =item --dump-depmap
1256
1257 =item --no-dump-depmap
1258
1259 When using staged preload, dump the depmap for each stage as json files
1260
1261
1262 =item --event-timeout SECONDS
1263
1264 =item --et SECONDS
1265
1266 =item --no-event-timeout
1267
1268 Kill test if no output is received within timeout period. (Default: 60 seconds). Add the "# HARNESS-NO-TIMEOUT" comment to the top of a test file to disable timeouts on a per-test basis. This prevents a hung test from running forever.
1269
1270
1271 =item --fail-on-resource-skip
1272
1273 =item --no-fail-on-resource-skip
1274
1275 Treat resource-skipped tests as failures instead of skips. When enabled, tests that would be skipped due to unavailable resources will be marked as failing.
1276
1277
1278 =item --include ARG
1279
1280 =item --include=ARG
1281
1282 =item -I ARG
1283
1284 =item -I=ARG
1285
1286 =item --no-include
1287
1288 Add a directory to your include paths
1289
1290 Can be specified multiple times
1291
1292
1293 =item --job-count 4
1294
1295 =item --job-count 8:2
1296
1297 =item --jobs 4
1298
1299 =item --jobs 8:2
1300
1301 =item -j4
1302
1303 =item -j8:2
1304
1305 =item --no-job-count
1306
1307 Set the number of concurrent jobs to run. Add a :# if you also wish to designate multiple slots per test. 8:2 means 8 slots, but each test gets 2 slots, so 4 tests run concurrently. Tests can find their concurrency assignment in the "T2_HARNESS_MY_JOB_CONCURRENCY" environment variable.
1308
1309 Can also be set with the following environment variables: C<YATH_JOB_COUNT>, C<T2_HARNESS_JOB_COUNT>, C<HARNESS_JOB_COUNT>
1310
1311
1312 =item --lib
1313
1314 =item -l
1315
1316 =item --no-lib
1317
1318 (Default: include if it exists) Include 'lib' in your module path
1319
1320
1321 =item --nytprof
1322
1323 =item --no-nytprof
1324
1325 Use Devel::NYTProf on tests. This will set addpid=1 for you. This works with or without fork.
1326
1327
1328 =item --post-exit-timeout SECONDS
1329
1330 =item --pet SECONDS
1331
1332 =item --no-post-exit-timeout
1333
1334 Stop waiting post-exit after the timeout period. (Default: 15 seconds) Some tests fork and allow the parent to exit before writing all their output. If Test2::Harness detects an incomplete plan after the test exits it will monitor for more events until the timeout period. Add the "# HARNESS-NO-TIMEOUT" comment to the top of a test file to disable timeouts on a per-test basis.
1335
1336
1337 =item --preload-threshold ARG
1338
1339 =item --preload-threshold=ARG
1340
1341 =item --Pt ARG
1342
1343 =item --Pt=ARG
1344
1345 =item -W ARG
1346
1347 =item -W=ARG
1348
1349 =item --no-preload-threshold
1350
1351 Only do preload if at least N tests are going to be run. In some cases a full preload takes longer than simply running the tests, this lets you specify a minimum number of test jobs that will be run for preload to happen. This has no effect for a persistent runner. The default is 0, and it means always preload.
1352
1353
1354 =item --preloads ARG
1355
1356 =item --preloads=ARG
1357
1358 =item --preload ARG
1359
1360 =item --preload=ARG
1361
1362 =item -P ARG
1363
1364 =item -P=ARG
1365
1366 =item --no-preloads
1367
1368 Preload a module before running tests
1369
1370 Can be specified multiple times
1371
1372
1373 =item --resource-timeout SECONDS
1374
1375 =item --rt SECONDS
1376
1377 =item --no-resource-timeout
1378
1379 Abort the test run if no tests have been able to start for SECONDS seconds while there are pending tests and none running. This is useful when a resource class is broken and always claims a resource will become available, preventing yath from ever finishing. (Default: 0, meaning no timeout)
1380
1381
1382 =item --resource Port
1383
1384 =item --resource +Test2::Harness::Runner::Resource::Port
1385
1386 =item -R Port
1387
1388 =item --no-resource
1389
1390 Use a resource module to assign resource assignments to individual tests
1391
1392 Can be specified multiple times
1393
1394
1395 =item --runner-id ARG
1396
1397 =item --runner-id=ARG
1398
1399 =item --no-runner-id
1400
1401 Runner ID (usually a generated uuid)
1402
1403
1404 =item --shared-jobs-config .sharedjobslots.yml
1405
1406 =item --shared-jobs-config relative/path/.sharedjobslots.yml
1407
1408 =item --shared-jobs-config /absolute/path/.sharedjobslots.yml
1409
1410 =item --no-shared-jobs-config
1411
1412 Where to look for a shared slot config file. If a filename with no path is provided yath will search the current and all parent directories for the name.
1413
1414
1415 =item --slots-per-job 2
1416
1417 =item -x2
1418
1419 =item --no-slots-per-job
1420
1421 This sets the number of slots each job will use (default 1). This is normally set by the ':#' in '-j#:#'.
1422
1423 Can also be set with the following environment variables: C<T2_HARNESS_JOB_CONCURRENCY>
1424
1425
1426 =item --stall-report
1427
1428 =item --stall-report=STRONG:LOOSE
1429
1430 =item --stall-report=SECONDS
1431
1432 =item --no-stall-report
1433
1434 Print diagnostics when the scheduler appears to have stopped starting tests. Give it alone for sensible waits, or set them: STRONG is the wait, in seconds, before reporting when tests are pending and none are running; LOOSE is the wait when tests are pending and others are still running. A single number sets both, and a zero in either field turns off that tier alone, so 600:0 reports only when nothing is running. This only prints a report, it never ends the run, and a report may be benign. Enabling it sends SIGUSR1 to yath's own processes to collect stack traces, pauses output for a few seconds per report, stops after 5 reports, and writes a yath-stall-report-*.json bundle both into the run log and to a file (see --stall-report-dir). (Default: off; --stall-report alone means 600:1200)
1435
1436
1437 =item --stall-report-dir path/to/dir
1438
1439 =item --no-stall-report-dir
1440
1441 Directory for the JSON bundle --stall-report writes. Defaults to the directory yath was run from. Use this when that directory is not writable, or to collect bundles somewhere durable.
1442
1443
1444 =item --switch ARG
1445
1446 =item --switch=ARG
1447
1448 =item -S ARG
1449
1450 =item -S=ARG
1451
1452 =item --no-switch
1453
1454 Pass the specified switch to perl for each test. This is not compatible with preload.
1455
1456 Can be specified multiple times
1457
1458
1459 =item --tlib
1460
1461 =item --no-tlib
1462
1463 (Default: off) Include 't/lib' in your module path
1464
1465
1466 =item --unsafe-inc
1467
1468 =item --no-unsafe-inc
1469
1470 perl is removing '.' from @INC as a security concern. This option keeps things from breaking for now.
1471
1472 Can also be set with the following environment variables: C<PERL_USE_UNSAFE_INC>
1473
1474
1475 =item --use-fork
1476
1477 =item --fork
1478
1479 =item --no-use-fork
1480
1481 (default: on, except on windows) Normally tests are run by forking, which allows for features like preloading. This will turn off the behavior globally (which is not compatible with preloading). This is slower, it is better to tag misbehaving tests with the '# HARNESS-NO-PRELOAD' comment in their header to disable forking only for those tests.
1482
1483 Can also be set with the following environment variables: C<!T2_NO_FORK>, C<T2_HARNESS_FORK>, C<!T2_HARNESS_NO_FORK>, C<YATH_FORK>, C<!YATH_NO_FORK>
1484
1485
1486 =item --use-timeout
1487
1488 =item --timeout
1489
1490 =item --no-use-timeout
1491
1492 (default: on) Enable/disable timeouts
1493
1494
1495 =back
1496
1497 =head3 Workspace Options
1498
1499 =over 4
1500
1501 =item --clear
1502
1503 =item -C
1504
1505 =item --no-clear
1506
1507 Clear the work directory if it is not already empty
1508
1509
1510 =item --tmp-dir ARG
1511
1512 =item --tmp-dir=ARG
1513
1514 =item --tmpdir ARG
1515
1516 =item --tmpdir=ARG
1517
1518 =item -t ARG
1519
1520 =item -t=ARG
1521
1522 =item --no-tmp-dir
1523
1524 Use a specific temp directory (Default: use system temp dir)
1525
1526 Can also be set with the following environment variables: C<T2_HARNESS_TEMP_DIR>, C<YATH_TEMP_DIR>, C<TMPDIR>, C<TEMPDIR>, C<TMP_DIR>, C<TEMP_DIR>
1527
1528
1529 =item --workdir ARG
1530
1531 =item --workdir=ARG
1532
1533 =item -w ARG
1534
1535 =item -w=ARG
1536
1537 =item --no-workdir
1538
1539 Set the work directory (Default: new temp directory)
1540
1541 Can also be set with the following environment variables: C<T2_WORKDIR>, C<YATH_WORKDIR>
1542
1543
1544 =back
1545
1546 =head3 YathUI Options
1547
1548 =over 4
1549
1550 =item --yathui-api-key ARG
1551
1552 =item --yathui-api-key=ARG
1553
1554 =item --no-yathui-api-key
1555
1556 Yath-UI API key. This is not necessary if your Yath-UI instance is set to single-user
1557
1558
1559 =item --yathui-coverage
1560
1561 =item --no-yathui-coverage
1562
1563 Poll coverage data from Yath-UI to determine what tests should be run for changed files
1564
1565
1566 =item --yathui-durations
1567
1568 =item --no-yathui-durations
1569
1570 Poll duration data from Yath-UI to help order tests efficiently
1571
1572
1573 =item --yathui-grace
1574
1575 =item --no-yathui-grace
1576
1577 If yath cannot connect to yath-ui it normally throws an error, use this to make it fail gracefully. You get a warning, but things keep going.
1578
1579
1580 =item --yathui-long-duration 10
1581
1582 =item --no-yathui-long-duration
1583
1584 Minimum duration length (seconds) before a test goes from MEDIUM to LONG
1585
1586
1587 =item --yathui-medium-duration 5
1588
1589 =item --no-yathui-medium-duration
1590
1591 Minimum duration length (seconds) before a test goes from SHORT to MEDIUM
1592
1593
1594 =item --yathui-mode summary
1595
1596 =item --yathui-mode qvf
1597
1598 =item --yathui-mode qvfd
1599
1600 =item --yathui-mode complete
1601
1602 =item --no-yathui-mode
1603
1604 Set the upload mode (default 'qvfd')
1605
1606
1607 =item --yathui-project ARG
1608
1609 =item --yathui-project=ARG
1610
1611 =item --no-yathui-project
1612
1613 The Yath-UI project for your test results
1614
1615
1616 =item --yathui-retry
1617
1618 =item --no-yathui-retry
1619
1620 How many times to try an operation before giving up
1621
1622 Can be specified multiple times
1623
1624
1625 =item --yathui-upload
1626
1627 =item --no-yathui-upload
1628
1629 Upload the log to Yath-UI
1630
1631
1632 =item --yathui-url http://my-yath-ui.com/...
1633
1634 =item --uri http://my-yath-ui.com/...
1635
1636 =item --no-yathui-url
1637
1638 Yath-UI url
1639
1640
1641 =back
1642
1643 =head1 SOURCE
1644
1645 The source code repository for Test2-Harness can be found at
1646 F<http://github.com/Test-More/Test2-Harness/>.
1647
1648 =head1 MAINTAINERS
1649
1650 =over 4
1651
1652 =item Chad Granum E<lt>[email protected]<gt>
1653
1654 =back
1655
1656 =head1 AUTHORS
1657
1658 =over 4
1659
1660 =item Chad Granum E<lt>[email protected]<gt>
1661
1662 =back
1663
1664 =head1 COPYRIGHT
1665
1666 Copyright 2026 Chad Granum E<lt>[email protected]<gt>.
1667
1668 This program is free software; you can redistribute it and/or
1669 modify it under the same terms as Perl itself.
1670
1671 See F<http://dev.perl.org/licenses/>
1672
1673 =cut
1674