1NAME
2 CPAN::Reporter::Smoker - Turnkey CPAN Testers smoking
3
4VERSION
5 version 0.29
6
7SYNOPSIS
8 $ perl -MCPAN::Reporter::Smoker -e start
9
10DESCRIPTION
11 Rudimentary smoke tester for CPAN Testers, built upon CPAN::Reporter.
12 Use at your own risk. It requires a recent version of CPAN::Reporter to
13 run.
14
15 Currently, CPAN::Reporter::Smoker requires zero independent
16 configuration; instead it uses configuration settings from CPAN.pm and
17 CPAN::Reporter.
18
19 Once started, it retrieves a list of distributions from the configured
20 CPAN mirror and begins testing them in reverse order of upload. It will
21 skip any distribution which has already had a report sent by
22 CPAN::Reporter.
23
24 Features (or bugs, depending on your point of view):
25
26 * No configuration needed
27
28 * Tests each distribution as a separate CPAN process -- each
29 distribution has prerequisites like build_requires satisfied from
30 scratch
31
32 * Automatically checks for new distributions every twelve hours or as
33 otherwise specified
34
35 * Continues until interrupted with CTRL-C
36
37 * Checks CPAN.pm "distroprefs" to see if distributions should be
38 skipped (before handing off to CPAN)
39
40 Current limitations:
41
42 * Does not attempt to retest distributions that had reports discarded
43 because of prerequisites that could not be satisfied
44
45 * Does not test trial version if there is no non-trial version
46
47 WARNING -- smoke testing is risky
48 Smoke testing will download and run programs that other people have
49 uploaded to CPAN. These programs could do anything to your system,
50 including deleting everything on it. Do not run CPAN::Reporter::Smoker
51 unless you are prepared to take these risks.
52
53USAGE
54 "start()"
55 Starts smoke testing using defaults already in CPAN::Config and
56 CPAN::Reporter's .cpanreporter directory. Runs until all distributions
57 are tested or the process is halted with CTRL-C or otherwise killed.
58
59 "start()" supports several optional arguments:
60
61 * "clean_cache_after" -- number of distributions that will be tested
62 before checking to see if the CPAN build cache needs to be cleaned
63 up (not including any prerequisites tested). Must be a positive
64 integer. Defaults to 100
65
66 * "list" -- if provided, this list of distributions will be tested
67 instead of all of CPAN. May be a reference to an array of
68 distribution names or may be a filename containing one distribution
69 name per line. Distribution names must be of the form
70 'AUTHOR/Dist-Name-0.00.tar.gz'
71
72 * "restart_delay" -- number of seconds that must elapse before
73 restarting smoke testing. This will reload indices to search for new
74 distributions and restart testing from the most recent distribution.
75 Must be a positive integer; Defaults to 43200 seconds (12 hours)
76
77 * "skip_dev_versions" -- if true, unindexed distributions will not be
78 tested. Valid values are 0 or 1. Defaults to 0.
79
80 * "set_term_title" -- toggle for whether the terminal titlebar will be
81 updated with the distribution being smoke tested and the starting
82 time of the test. Helps determine if a test is hung and which
83 distribution might be responsible. Valid values are 0 or 1. Defaults
84 to 1
85
86 * "status_file" -- during testing, the name of the distribution under
87 test and a timestamp are written to this file. The file is removed
88 after the test is complete. This helps identify a problem
89 distribution if testing hangs or crashes the computer. If the
90 argument includes a path, all directories to the file must exist.
91 Defaults to "smoker-status-$$.txt" in File::Spec->tmpdir.
92
93 * "install" -- toggle for whether the distribution should be installed
94 after successful testing. Can be useful to avoid prerequisite
95 re-building and growing PERL5LIB for the cost of disk space used for
96 installed modules. Valid values are 0 or 1. Defaults to 0
97
98 * "reverse" -- toggle the order in which releases are tested. When set
99 to 1, testing starts from the older release not the most recent one
100 (or the last distribution if --list is provided). Valid values are 0
101 or 1. Defaults to 0
102
103 * "random" -- toggle whether to randomize distribution test order.
104 When set to 1, the list of releases is shuffled. Valid values are 0
105 or 1. Defaults to 0
106
107 * "force_trust" -- toggle whether to override CPAN's
108 "trust_test_report_history" option. When set to 1,
109 "trust_test_report_history" is set to 1. When set to 0,
110 "trust_test_report_history" is left alone and whatever the user has
111 configured for their CPAN client is used. Valid values are 0 or 1.
112 Defaults to 0
113
114 * "reload_history_period" -- after this period in seconds, history of
115 modules smoked will be reloaded when possible. Default value 1800
116 seconds (30 minutes).
117
118HINTS
119 Selection of distributions to test
120 Only the most recently uploaded developer and normal releases will be
121 tested, and only if the developer release is newer than the regular
122 release indexed by PAUSE.
123
124 For example, if Foo-Bar-0.01, Foo-Bar-0.02, Foo-Bar-0.03_01 and
125 Foo-Bar-0.03_02 are on CPAN, only Foo-Bar-0.02 and Foo-Bar-0.03_02 will
126 be tested, and in reverse order of when they were uploaded. Once
127 Foo-Bar-0.04 is released and indexed, Foo-Bar-0.03_02 will not longer be
128 tested.
129
130 To avoid testing script or other tarballs, developer distributions
131 included must have a base distribution name that resembles a
132 distribution tarball already indexed by PAUSE. If the first upload of
133 distribution to PAUSE is a developer release -- Baz-Bam-0.00_01.tar.gz
134 -- it will not be tested as there is no indexed Baz-Bam appearing in
135 CPAN's 02packages.details.txt file.
136
137 Unauthorized tarballs are treated like developer releases and will be
138 tested if they resemble an indexed distribution and are newer than the
139 indexed tarball.
140
141 Perl, parrot, kurila, Pugs and similar distributions will not be tested.
142 The skip list is based on CPAN::Mini and matches as follows:
143
144 qr{(?:
145 /(?:emb|syb|bio)?perl-\d
146 | /(?:parrot|ponie|kurila|Perl6-Pugs)-\d
147 | /perl-?5\.004
148 | /perl_mlb\.zip
149 )}xi,
150
151 Bundles and mod_perl distributions will also not be tested, though
152 mod_perl is likely to be requested as a dependency by many modules. See
153 the next section for how to tell CPAN.pm not to test certain
154 dependencies.
155
156 Skipping additional distributions
157 If certain distributions hang, crash or otherwise cause trouble, you can
158 use CPAN's "distroprefs" system to disable them. If a distribution is
159 disabled, it won't be built or tested. If a distribution's dependency is
160 disabled, a failing test is just discarded.
161
162 The first step is configuring a directory for distroprefs files:
163
164 $ cpan
165 cpan> o conf init prefs_dir
166 cpan> o conf commit
167
168 Next, ensure that either the YAML or YAML::Syck module is installed.
169 (YAML::Syck is faster). Then create a file in the "prefs_dir" directory
170 to hold the list of distributions to disable, e.g. call it
171 "disabled.yml"
172
173 In that file, you can add blocks of YAML code to disable distributions.
174 The match criteria "distribution" is a regex that matches against the
175 canonical name of a distribution, e.g. "AUTHOR/Foo-Bar-3.14.tar.gz".
176
177 Here is a sample file to show you some syntax (don't actually use these,
178 though):
179
180 ---
181 comment: "Tests take too long"
182 match:
183 distribution: "^DAGOLDEN/CPAN-Reporter-\d"
184 disabled: 1
185 ---
186 comment: "Skip Win32 distributions"
187 match:
188 distribution: "/Win32"
189 disabled: 1
190 ---
191 comment: "Skip distributions by Andy Lester"
192 match:
193 distribution: "^PETDANCE"
194 disabled: 1
195
196 Please note that disabling distributions like this will also disable
197 them for normal, non-smoke usage of CPAN.pm.
198
199 One distribution that I would recommend either installing up front or
200 else disabling with distroprefs is mod_perl, as it is a common
201 requirement for many Apache:: modules but does not (easily) build and
202 test under automation.
203
204 ---
205 comment: "Don't build mod_perl if required by some other module"
206 match:
207 distribution: "/mod_perl-\d"
208 disabled: 1
209
210 Distroprefs are more powerful than this -- they can be used to automate
211 responses to prompts in distributions, set environment variables,
212 specify additional dependencies and so on. Read the docs for CPAN.pm for
213 more and look in the "distroprefs" directory in the CPAN distribution
214 tarball for examples.
215
216 Using a local CPAN::Mini mirror
217 Because distributions must be retrieved from a CPAN mirror, the smoker
218 may cause heavy network load and will repetitively download common build
219 prerequisites.
220
221 An alternative is to use CPAN::Mini to create a local CPAN mirror and to
222 point CPAN's "urllist" to the local mirror.
223
224 $ cpan
225 cpan> o conf urllist unshift file:///path/to/minicpan
226 cpan> o conf commit
227
228 However, CPAN::Reporter::Smoker needs the "find-ls.gz" file, which
229 CPAN::Mini does not mirror by default. Add it to a .minicpanrc file in
230 your home directory to include it in your local CPAN mirror.
231
232 also_mirror: indices/find-ls.gz
233
234 Note that CPAN::Mini does not mirror developer versions. Therefore, a
235 live, network CPAN Mirror will be needed in the urllist to retrieve
236 these.
237
238 Note that CPAN requires the LWP module to be installed to use a local
239 CPAN mirror.
240
241 Alternatively, you might experiment with the alpha-quality release of
242 CPAN::Mini::Devel, which subclasses CPAN::Mini to retrieve developer
243 distributions (and find-ls.gz) using the same logic as
244 CPAN::Reporter::Smoker.
245
246 Timing out hanging tests
247 CPAN::Reporter (since 1.08) supports a 'command_timeout' configuration
248 option. Set this option in the CPAN::Reporter configuration file to time
249 out tests that hang up or get stuck at a prompt. Set it to a high-value
250 to avoid timing out a lengthy tests that are still running -- 1000 or
251 more seconds is probably enough.
252
253 Warning -- on Win32, terminating processes via the command_timeout is
254 equivalent to SIGKILL and could cause system instability or later
255 deadlocks
256
257 This option is still considered experimental.
258
259 Avoiding repetitive prerequisite testing
260 Because CPAN::Reporter::Smoker satisfies all requirements from scratch,
261 common dependencies (e.g. Class::Accessor) will be unpacked, built and
262 tested repeatedly.
263
264 As of version 1.92_56, CPAN supports the "trust_test_report_history"
265 config option. When set, CPAN will check the last test report for a
266 distribution. If one is found, the results of that test are used instead
267 of running tests again.
268
269 $ cpan
270 cpan> o conf init trust_test_report_history
271 cpan> o conf commit
272
273 Avoiding repetitive prerequisite builds (EXPERIMENTAL)
274 CPAN has a "build_dir_reuse" config option. When set (and if a YAML
275 module is installed and configured), CPAN will attempt to make build
276 directories persistent. This has the potential to save substantial time
277 and space during smoke testing. CPAN::Reporter::Smoker will recognize if
278 this option is set and make adjustments to the test process to keep
279 PERL5LIB from growing uncontrollably as the number of persistent
280 directories increases.
281
282 NOTE: Support for "build_dir_reuse" is highly experimental. Wait for at
283 least CPAN version 1.92_62 before trying this option.
284
285 $ cpan
286 cpan> o conf init build_dir_reuse
287 cpan> o conf commit
288
289 Stopping early if a prerequisite fails
290 Normally, CPAN.pm continues testing a distribution even if a
291 prerequisite fails to build or fails testing. Some distributions may
292 pass their tests even without a listed prerequisite, but most just fail
293 (and CPAN::Reporter discards failures if prerequisites are not met).
294
295 As of version 1.92_57, CPAN supports the "halt_on_failure" config
296 option. When set, a prerequisite failure stops further processing.
297
298 $ cpan
299 cpan> o conf init halt_on_failure
300 cpan> o conf commit
301
302 However, a disadvantage of halting early is that no DISCARD grade is
303 recorded in the history. The next time CPAN::Reporter::Smoker runs, the
304 distribution will be tested again from scratch. It may be better to let
305 all prerequisites finish so the distribution can fail its test and be
306 flagged with DISCARD so it will be skipped in the future.
307
308 CPAN cache bloat
309 CPAN will use a lot of scratch space to download, build and test
310 modules. Use CPAN's built-in cache management configuration to let it
311 purge the cache periodically if you don't want to do this manually. When
312 configured, the cache will be purged on start and after a certain number
313 of distributions have been tested as determined by the
314 "clean_cache_after" option for the "start()" function.
315
316 $ cpan
317 cpan> o conf init build_cache scan_cache
318 cpan> o conf commit
319
320 CPAN verbosity
321 Recent versions of CPAN are verbose by default, but include some lesser
322 known configuration settings to minimize this for untarring
323 distributions and for loading support modules. Setting the verbosity for
324 these to 'none' will minimize some of the clutter to the screen as
325 distributions are tested.
326
327 $ cpan
328 cpan> o conf init /verbosity/
329 cpan> o conf commit
330
331 Saving reports to files instead of sending directly
332 In some cases, such as when smoke testing using a development or
333 prerelease toolchain module like Test-Harness, it may be preferable to
334 save reports to files in a directory for review prior to submitting
335 them. To do this, manually set the "transport" option in your
336 CPAN::Reporter config file to use the Test::Reporter::Transport::File
337 transport.
338
339 transport=File /path/to/directory
340
341 After review, send saved reports using Test::Reporter:
342
343 Test::Reporter->new()->read($filename)->send()
344
345ENVIRONMENT
346 Automatically sets the following environment variables to true values
347 while running:
348
349 * "AUTOMATED_TESTING" -- signal that tests are being run by an
350 automated smoke testing program (i.e. don't expect interactivity)
351
352 * "PERL_MM_USE_DEFAULT" -- accept ExtUtils::MakeMaker prompt()
353 defaults
354
355 * "PERL_EXTUTILS_AUTOINSTALL" -- set to '--defaultdeps' for default
356 dependencies
357
358 The following environment variables, if set, will modify the behavior of
359 CPAN::Reporter::Smoker. Generally, they are only required during the
360 testing of CPAN::Reporter::Smoker
361
362 * "PERL_CR_SMOKER_RUNONCE" -- if true, "start()" will exit after all
363 distributions are tested instead of sleeping for the "restart_delay"
364 and then continuing
365
366 * "PERL_CR_SMOKER_SHORTCUT" -- if true, "start()" will process
367 arguments (if any) but will return before starting smoke testing;
368 used for testing argument handling by "start()"
369
370BUGS
371 Please report any bugs or feature using the CPAN Request Tracker. Bugs
372 can be submitted through the web interface at
373 <http://rt.cpan.org/Dist/Display.html?Queue=CPAN-Reporter-Smoker>
374
375 When submitting a bug or request, please include a test-file or a patch
376 to an existing test-file that illustrates the bug or desired feature.
377
378SEE ALSO
379 * CPAN
380
381 * CPAN::Reporter
382
383 * CPAN::Testers
384
385 * CPAN::Mini
386
387 * CPAN::Mini::Devel
388
389SUPPORT
390 Bugs / Feature Requests
391 Please report any bugs or feature requests through the issue tracker at
392 <https://github.com/cpan-testers/CPAN-Reporter-Smoker/issues>. You will
393 be notified automatically of any progress on your issue.
394
395 Source Code
396 This is open source software. The code repository is available for
397 public review and contribution under the terms of the license.
398
399 <https://github.com/cpan-testers/CPAN-Reporter-Smoker>
400
401 git clone https://github.com/cpan-testers/CPAN-Reporter-Smoker.git
402
403AUTHOR
404 David Golden <dagolden@cpan.org>
405
406CONTRIBUTORS
407 * Alexandr Ciornii <alexchorny@gmail.com>
408
409 * Christian Walde <walde.christian@googlemail.com>
410
411 * gregor herrmann <gregoa@cpan.org>
412
413COPYRIGHT AND LICENSE
414 This software is Copyright (c) 2017 by David Golden.
415
416 This is free software, licensed under:
417
418 The Apache License, Version 2.0, January 2004
419
420