Debian Codegraph @

lib/App/Yath/Command/start.pm

raw
1 package App::Yath::Command::start;
2 use strict;
3 use warnings;
4
5 our $VERSION = '1.000179';
6
7 use App::Yath::Util qw/find_pfile/;
8 use App::Yath::Options;
9
10 use Test2::Harness::Run;
11 use Test2::Harness::Util::Queue;
12 use Test2::Harness::Util::File::JSON;
13 use Test2::Harness::IPC;
14
15 use Test2::Harness::Util::JSON qw/encode_json decode_json/;
16 use Test2::Harness::Util qw/mod2file open_file parse_exit clean_path/;
17 use Test2::Util::Table qw/table/;
18
19 use Test2::Harness::Util::IPC qw/run_cmd USE_P_GROUPS/;
20
21 use POSIX;
22 use File::Spec;
23 use Sys::Hostname qw/hostname/;
24
25 use Time::HiRes qw/sleep/;
26
27 use Carp qw/croak/;
28 use File::Path qw/remove_tree/;
29
30 use parent 'App::Yath::Command';
31 use Test2::Harness::Util::HashBase;
32
33 include_options(
34 'App::Yath::Options::Debug',
35 'App::Yath::Options::PreCommand',
36 'App::Yath::Options::Runner',
37 'App::Yath::Options::Workspace',
38 'App::Yath::Options::Persist',
39 'App::Yath::Options::Collector',
40 );
41
42 option_group {prefix => 'runner', category => "Persistent Runner Options"} => sub {
43 option reload => (
44 short => 'r',
45 type => 'b',
46 description => "Attempt to reload modified modules in-place, restarting entire stages only when necessary.",
47 default => 0,
48 );
49
50 option restrict_reload => (
51 type => 'D',
52 long_examples => ['', '=path'],
53 short_examples => ['', '=path'],
54 description => "Only reload modules under the specified path, if no path is specified look at anything under the .yath.rc path, or the current working directory.",
55
56 normalize => sub { $_[0] eq '1' ? $_[0] : clean_path($_[0]) },
57 action => \&restrict_action,
58 );
59
60 option quiet => (
61 short => 'q',
62 type => 'c',
63 description => "Be very quiet.",
64 default => 0,
65 );
66 };
67
68 sub restrict_action {
69 my ($prefix, $field, $raw, $norm, $slot, $settings) = @_;
70
71 if ($norm eq '1') {
72 my $hset = $settings->harness;
73 my $path = $hset->config_file || $hset->cwd;
74 $path //= do { require Cwd; Cwd::getcwd() };
75 $path =~ s{\.yath\.rc$}{}g;
76 push @{$$slot} => $path;
77 }
78 else {
79 push @{$$slot} => $norm;
80 }
81 }
82
83 sub MAX_ATTACH() { 1_048_576 }
84
85 sub group { 'persist' }
86
87 sub always_keep_dir { 1 }
88
89 sub summary { "Start the persistent test runner" }
90 sub cli_args { "" }
91
92 sub description {
93 return <<" EOT";
94 This command is used to start a persistent instance of yath. A persistent
95 instance is useful because it allows you to preload modules in advance,
96 reducing start time for any tests you decide to run as you work.
97
98 A running instance will watch for changes to any preloaded files, and restart
99 itself if anything changes. Changed files are blacklisted for subsequent
100 reloads so that reloading is not a frequent occurence when editing the same
101 file over and over again.
102 EOT
103 }
104
105 sub run {
106 my $self = shift;
107
108 $ENV{TEST2_HARNESS_NO_WRITE_TEST_INFO} //= 1;
109
110 my $settings = $self->settings;
111 my $dir = $settings->workspace->workdir;
112
113 my $pfile = find_pfile($settings, vivify => 1, no_checks => 1);
114
115 if (-f $pfile) {
116 remove_tree($dir, {safe => 1, keep_root => 0});
117 die "Persistent harness appears to be running, found $pfile\n";
118 }
119
120 $self->write_settings_to($dir, 'settings.json');
121
122 my $run_queue = Test2::Harness::Util::Queue->new(file => File::Spec->catfile($dir, 'run_queue.jsonl'));
123 $run_queue->start();
124
125 $self->setup_plugins();
126 $self->setup_resources();
127
128 my $stderr = File::Spec->catfile($dir, 'error.log');
129 my $stdout = File::Spec->catfile($dir, 'output.log');
130
131 my @prof;
132 if ($settings->runner->nytprof) {
133 push @prof => '-d:NYTProf';
134 }
135
136 my $pid = run_cmd(
137 stderr => $stderr,
138 stdout => $stdout,
139
140 no_set_pgrp => !$settings->runner->daemon,
141
142 command => [
143 $^X, @prof, $settings->harness->script,
144 (map { "-D$_" } @{$settings->harness->dev_libs}),
145 '--no-scan-plugins', # Do not preload any plugin modules
146 runner => $dir,
147 monitor_preloads => 1,
148 persist => $pfile,
149 jobs_todo => 0,
150 ],
151 );
152
153 unless ($settings->runner->quiet) {
154 print "\nPersistent runner started!\n";
155
156 print "Runner PID: $pid\n";
157 print "Runner dir: $dir\n";
158 print "\nUse `yath watch` to monitor the persistent runner\n\n" if $settings->runner->daemon;
159 }
160
161 Test2::Harness::Util::File::JSON->new(name => $pfile)->write({
162 pid => $pid,
163 dir => $dir,
164 version => $VERSION,
165 user => $ENV{USER},
166 hostname => hostname(),
167 });
168
169 return 0 if $settings->runner->daemon;
170
171 $SIG{TERM} = sub { kill(TERM => $pid) };
172 $SIG{INT} = sub { kill(INT => $pid) };
173
174 my $err_fh = open_file($stderr, '<');
175 my $out_fh = open_file($stdout, '<');
176
177 local $?;
178 while (1) {
179 my $out = waitpid($pid, WNOHANG);
180 my $wstat = $?;
181
182 my $count = 0;
183 seek($out_fh, 0, 1) if eof($out_fh);
184 while (my $line = <$out_fh>) {
185 $count++;
186 print STDOUT $line;
187 }
188 seek($err_fh, 0, 1) if eof($err_fh);
189 while (my $line = <$err_fh>) {
190 $count++;
191 print STDERR $line;
192 }
193
194 sleep(0.02) unless $out || $count;
195
196 next if $out == 0;
197 return 255 if $out < 0;
198
199 my $exit = parse_exit($?);
200 return $exit->{err} || $exit->{sig} || 0;
201 }
202 }
203
204 1;
205
206 __END__
207
208 =pod
209
210 =encoding UTF-8
211
212 =head1 NAME
213
214 App::Yath::Command::start - Start the persistent test runner
215
216 =head1 DESCRIPTION
217
218 This command is used to start a persistent instance of yath. A persistent
219 instance is useful because it allows you to preload modules in advance,
220 reducing start time for any tests you decide to run as you work.
221
222 A running instance will watch for changes to any preloaded files, and restart
223 itself if anything changes. Changed files are blacklisted for subsequent
224 reloads so that reloading is not a frequent occurence when editing the same
225 file over and over again.
226
227
228 =head1 USAGE
229
230 $ yath [YATH OPTIONS] start [COMMAND OPTIONS]
231
232 =head2 YATH OPTIONS
233
234 =head3 Developer
235
236 =over 4
237
238 =item --dev-lib
239
240 =item --dev-lib=lib
241
242 =item -D
243
244 =item -D=lib
245
246 =item -Dlib
247
248 =item --no-dev-lib
249
250 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.
251
252 Can be specified multiple times
253
254
255 =back
256
257 =head3 Environment
258
259 =over 4
260
261 =item --persist-dir ARG
262
263 =item --persist-dir=ARG
264
265 =item --no-persist-dir
266
267 Where to find persistence files.
268
269
270 =item --persist-file ARG
271
272 =item --persist-file=ARG
273
274 =item --pfile ARG
275
276 =item --pfile=ARG
277
278 =item --no-persist-file
279
280 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.
281
282
283 =item --project ARG
284
285 =item --project=ARG
286
287 =item --project-name ARG
288
289 =item --project-name=ARG
290
291 =item --no-project
292
293 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.
294
295
296 =back
297
298 =head3 Help and Debugging
299
300 =over 4
301
302 =item --show-opts
303
304 =item --no-show-opts
305
306 Exit after showing what yath thinks your options mean
307
308
309 =item --version
310
311 =item -V
312
313 =item --no-version
314
315 Exit after showing a helpful usage message
316
317
318 =back
319
320 =head3 Plugins
321
322 =over 4
323
324 =item --no-scan-plugins
325
326 =item --no-no-scan-plugins
327
328 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.
329
330
331 =item --plugins PLUGIN
332
333 =item --plugins +App::Yath::Plugin::PLUGIN
334
335 =item --plugins PLUGIN=arg1,arg2,...
336
337 =item --plugin PLUGIN
338
339 =item --plugin +App::Yath::Plugin::PLUGIN
340
341 =item --plugin PLUGIN=arg1,arg2,...
342
343 =item -pPLUGIN
344
345 =item --no-plugins
346
347 Load a yath plugin.
348
349 Can be specified multiple times
350
351
352 =back
353
354 =head2 COMMAND OPTIONS
355
356 =head3 Collector Options
357
358 =over 4
359
360 =item --max-open-jobs 18
361
362 =item --no-max-open-jobs
363
364 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)
365
366
367 =item --max-poll-events 1000
368
369 =item --no-max-poll-events
370
371 Maximum number of events to poll from a job before jumping to the next job. (Default: 1000)
372
373
374 =back
375
376 =head3 Cover Options
377
378 =over 4
379
380 =item --cover-aggregator ByTest
381
382 =item --cover-aggregator ByRun
383
384 =item --cover-aggregator +Custom::Aggregator
385
386 =item --cover-agg ByTest
387
388 =item --cover-agg ByRun
389
390 =item --cover-agg +Custom::Aggregator
391
392 =item --no-cover-aggregator
393
394 Choose a custom aggregator subclass
395
396
397 =item --cover-class ARG
398
399 =item --cover-class=ARG
400
401 =item --no-cover-class
402
403 Choose a Test2::Plugin::Cover subclass
404
405
406 =item --cover-dirs ARG
407
408 =item --cover-dirs=ARG
409
410 =item --cover-dir ARG
411
412 =item --cover-dir=ARG
413
414 =item --no-cover-dirs
415
416 NO DESCRIPTION - FIX ME
417
418 Can be specified multiple times
419
420
421 =item --cover-exclude-dirs ARG
422
423 =item --cover-exclude-dirs=ARG
424
425 =item --cover-exclude-dir ARG
426
427 =item --cover-exclude-dir=ARG
428
429 =item --no-cover-exclude-dirs
430
431 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.
432
433 Can be specified multiple times
434
435
436 =item --cover-exclude-private
437
438 =item --no-cover-exclude-private
439
440
441
442
443 =item --cover-files
444
445 =item --no-cover-files
446
447 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)
448
449
450 =item --cover-from path/to/log.jsonl
451
452 =item --cover-from http://example.com/coverage
453
454 =item --cover-from path/to/coverage.jsonl
455
456 =item --no-cover-from
457
458 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.
459
460
461 =item --cover-from-type json
462
463 =item --cover-from-type jsonl
464
465 =item --cover-from-type log
466
467 =item --no-cover-from-type
468
469 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.
470
471
472 =item --cover-manager My::Coverage::Manager
473
474 =item --no-cover-manager
475
476 Coverage 'from' manager to use when coverage data does not provide one
477
478
479 =item --cover-maybe-from path/to/log.jsonl
480
481 =item --cover-maybe-from http://example.com/coverage
482
483 =item --cover-maybe-from path/to/coverage.jsonl
484
485 =item --no-cover-maybe-from
486
487 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.
488
489
490 =item --cover-maybe-from-type json
491
492 =item --cover-maybe-from-type jsonl
493
494 =item --cover-maybe-from-type log
495
496 =item --no-cover-maybe-from-type
497
498 Same as "from_type" but for "maybe_from". Defaults to "from_type" if that is specified, otherwise auto-detect
499
500
501 =item --cover-metrics
502
503 =item --no-cover-metrics
504
505
506
507
508 =item --cover-types ARG
509
510 =item --cover-types=ARG
511
512 =item --cover-type ARG
513
514 =item --cover-type=ARG
515
516 =item --no-cover-types
517
518 NO DESCRIPTION - FIX ME
519
520 Can be specified multiple times
521
522
523 =item --cover-write
524
525 =item --cover-write=coverage.jsonl
526
527 =item --cover-write=coverage.json
528
529 =item --no-cover-write
530
531 Create a json or jsonl file of all coverage data seen during the run (This implies --cover-files).
532
533
534 =back
535
536 =head3 Git Options
537
538 =over 4
539
540 =item --git-change-base master
541
542 =item --git-change-base HEAD^
543
544 =item --git-change-base df22abe4
545
546 =item --no-git-change-base
547
548 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.
549
550
551 =back
552
553 =head3 Help and Debugging
554
555 =over 4
556
557 =item --dummy
558
559 =item -d
560
561 =item --no-dummy
562
563 Dummy run, do not actually execute anything
564
565 Can also be set with the following environment variables: C<T2_HARNESS_DUMMY>
566
567
568 =item --help
569
570 =item -h
571
572 =item --no-help
573
574 exit after showing help information
575
576
577 =item --interactive
578
579 =item -i
580
581 =item --no-interactive
582
583 Use interactive mode, 1 test at a time, stdin forwarded to it
584
585
586 =item --keep-dirs
587
588 =item --keep_dir
589
590 =item -k
591
592 =item --no-keep-dirs
593
594 Do not delete directories when done. This is useful if you want to inspect the directories used for various commands.
595
596
597 =item --procname-prefix ARG
598
599 =item --procname-prefix=ARG
600
601 =item --no-procname-prefix
602
603 Add a prefix to all proc names (as seen by ps).
604
605
606 =back
607
608 =head3 Persistent Runner Options
609
610 =over 4
611
612 =item --quiet
613
614 =item -q
615
616 =item --no-quiet
617
618 Be very quiet.
619
620 Can be specified multiple times
621
622
623 =item --reload
624
625 =item -r
626
627 =item --no-reload
628
629 Attempt to reload modified modules in-place, restarting entire stages only when necessary.
630
631
632 =item --restrict-reload
633
634 =item --restrict-reload=path
635
636 =item --no-restrict-reload
637
638 Only reload modules under the specified path, if no path is specified look at anything under the .yath.rc path, or the current working directory.
639
640 Can be specified multiple times
641
642
643 =back
644
645 =head3 Runner Options
646
647 =over 4
648
649 =item --abort-on-bail
650
651 =item --no-abort-on-bail
652
653 Abort all testing if a bail-out is encountered (default: on)
654
655
656 =item --blib
657
658 =item -b
659
660 =item --no-blib
661
662 (Default: include if it exists) Include 'blib/lib' and 'blib/arch' in your module path
663
664
665 =item --cover
666
667 =item --cover=-silent,1,+ignore,^t/,+ignore,^t2/,+ignore,^xt,+ignore,^test.pl
668
669 =item --no-cover
670
671 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
672
673
674 =item --daemon
675
676 =item --no-daemon
677
678 Start the runner as a daemon (Default: True)
679
680
681 =item --dump-depmap
682
683 =item --no-dump-depmap
684
685 When using staged preload, dump the depmap for each stage as json files
686
687
688 =item --event-timeout SECONDS
689
690 =item --et SECONDS
691
692 =item --no-event-timeout
693
694 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.
695
696
697 =item --fail-on-resource-skip
698
699 =item --no-fail-on-resource-skip
700
701 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.
702
703
704 =item --include ARG
705
706 =item --include=ARG
707
708 =item -I ARG
709
710 =item -I=ARG
711
712 =item --no-include
713
714 Add a directory to your include paths
715
716 Can be specified multiple times
717
718
719 =item --job-count 4
720
721 =item --job-count 8:2
722
723 =item --jobs 4
724
725 =item --jobs 8:2
726
727 =item -j4
728
729 =item -j8:2
730
731 =item --no-job-count
732
733 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.
734
735 Can also be set with the following environment variables: C<YATH_JOB_COUNT>, C<T2_HARNESS_JOB_COUNT>, C<HARNESS_JOB_COUNT>
736
737
738 =item --lib
739
740 =item -l
741
742 =item --no-lib
743
744 (Default: include if it exists) Include 'lib' in your module path
745
746
747 =item --nytprof
748
749 =item --no-nytprof
750
751 Use Devel::NYTProf on tests. This will set addpid=1 for you. This works with or without fork.
752
753
754 =item --post-exit-timeout SECONDS
755
756 =item --pet SECONDS
757
758 =item --no-post-exit-timeout
759
760 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.
761
762
763 =item --preload-threshold ARG
764
765 =item --preload-threshold=ARG
766
767 =item --Pt ARG
768
769 =item --Pt=ARG
770
771 =item -W ARG
772
773 =item -W=ARG
774
775 =item --no-preload-threshold
776
777 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.
778
779
780 =item --preloads ARG
781
782 =item --preloads=ARG
783
784 =item --preload ARG
785
786 =item --preload=ARG
787
788 =item -P ARG
789
790 =item -P=ARG
791
792 =item --no-preloads
793
794 Preload a module before running tests
795
796 Can be specified multiple times
797
798
799 =item --resource-timeout SECONDS
800
801 =item --rt SECONDS
802
803 =item --no-resource-timeout
804
805 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)
806
807
808 =item --resource Port
809
810 =item --resource +Test2::Harness::Runner::Resource::Port
811
812 =item -R Port
813
814 =item --no-resource
815
816 Use a resource module to assign resource assignments to individual tests
817
818 Can be specified multiple times
819
820
821 =item --runner-id ARG
822
823 =item --runner-id=ARG
824
825 =item --no-runner-id
826
827 Runner ID (usually a generated uuid)
828
829
830 =item --shared-jobs-config .sharedjobslots.yml
831
832 =item --shared-jobs-config relative/path/.sharedjobslots.yml
833
834 =item --shared-jobs-config /absolute/path/.sharedjobslots.yml
835
836 =item --no-shared-jobs-config
837
838 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.
839
840
841 =item --slots-per-job 2
842
843 =item -x2
844
845 =item --no-slots-per-job
846
847 This sets the number of slots each job will use (default 1). This is normally set by the ':#' in '-j#:#'.
848
849 Can also be set with the following environment variables: C<T2_HARNESS_JOB_CONCURRENCY>
850
851
852 =item --stall-report
853
854 =item --stall-report=STRONG:LOOSE
855
856 =item --stall-report=SECONDS
857
858 =item --no-stall-report
859
860 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)
861
862
863 =item --stall-report-dir path/to/dir
864
865 =item --no-stall-report-dir
866
867 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.
868
869
870 =item --switch ARG
871
872 =item --switch=ARG
873
874 =item -S ARG
875
876 =item -S=ARG
877
878 =item --no-switch
879
880 Pass the specified switch to perl for each test. This is not compatible with preload.
881
882 Can be specified multiple times
883
884
885 =item --tlib
886
887 =item --no-tlib
888
889 (Default: off) Include 't/lib' in your module path
890
891
892 =item --unsafe-inc
893
894 =item --no-unsafe-inc
895
896 perl is removing '.' from @INC as a security concern. This option keeps things from breaking for now.
897
898 Can also be set with the following environment variables: C<PERL_USE_UNSAFE_INC>
899
900
901 =item --use-fork
902
903 =item --fork
904
905 =item --no-use-fork
906
907 (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.
908
909 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>
910
911
912 =item --use-timeout
913
914 =item --timeout
915
916 =item --no-use-timeout
917
918 (default: on) Enable/disable timeouts
919
920
921 =back
922
923 =head3 Workspace Options
924
925 =over 4
926
927 =item --clear
928
929 =item -C
930
931 =item --no-clear
932
933 Clear the work directory if it is not already empty
934
935
936 =item --tmp-dir ARG
937
938 =item --tmp-dir=ARG
939
940 =item --tmpdir ARG
941
942 =item --tmpdir=ARG
943
944 =item -t ARG
945
946 =item -t=ARG
947
948 =item --no-tmp-dir
949
950 Use a specific temp directory (Default: use system temp dir)
951
952 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>
953
954
955 =item --workdir ARG
956
957 =item --workdir=ARG
958
959 =item -w ARG
960
961 =item -w=ARG
962
963 =item --no-workdir
964
965 Set the work directory (Default: new temp directory)
966
967 Can also be set with the following environment variables: C<T2_WORKDIR>, C<YATH_WORKDIR>
968
969
970 =back
971
972 =head3 YathUI Options
973
974 =over 4
975
976 =item --yathui-api-key ARG
977
978 =item --yathui-api-key=ARG
979
980 =item --no-yathui-api-key
981
982 Yath-UI API key. This is not necessary if your Yath-UI instance is set to single-user
983
984
985 =item --yathui-grace
986
987 =item --no-yathui-grace
988
989 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.
990
991
992 =item --yathui-long-duration 10
993
994 =item --no-yathui-long-duration
995
996 Minimum duration length (seconds) before a test goes from MEDIUM to LONG
997
998
999 =item --yathui-medium-duration 5
1000
1001 =item --no-yathui-medium-duration
1002
1003 Minimum duration length (seconds) before a test goes from SHORT to MEDIUM
1004
1005
1006 =item --yathui-mode summary
1007
1008 =item --yathui-mode qvf
1009
1010 =item --yathui-mode qvfd
1011
1012 =item --yathui-mode complete
1013
1014 =item --no-yathui-mode
1015
1016 Set the upload mode (default 'qvfd')
1017
1018
1019 =item --yathui-project ARG
1020
1021 =item --yathui-project=ARG
1022
1023 =item --no-yathui-project
1024
1025 The Yath-UI project for your test results
1026
1027
1028 =item --yathui-retry
1029
1030 =item --no-yathui-retry
1031
1032 How many times to try an operation before giving up
1033
1034 Can be specified multiple times
1035
1036
1037 =item --yathui-url http://my-yath-ui.com/...
1038
1039 =item --uri http://my-yath-ui.com/...
1040
1041 =item --no-yathui-url
1042
1043 Yath-UI url
1044
1045
1046 =back
1047
1048 =head1 SOURCE
1049
1050 The source code repository for Test2-Harness can be found at
1051 F<http://github.com/Test-More/Test2-Harness/>.
1052
1053 =head1 MAINTAINERS
1054
1055 =over 4
1056
1057 =item Chad Granum E<lt>[email protected]<gt>
1058
1059 =back
1060
1061 =head1 AUTHORS
1062
1063 =over 4
1064
1065 =item Chad Granum E<lt>[email protected]<gt>
1066
1067 =back
1068
1069 =head1 COPYRIGHT
1070
1071 Copyright 2026 Chad Granum E<lt>[email protected]<gt>.
1072
1073 This program is free software; you can redistribute it and/or
1074 modify it under the same terms as Perl itself.
1075
1076 See F<http://dev.perl.org/licenses/>
1077
1078 =cut
1079