Skip to content

Commit 1488c64

Browse files
committed
You can now index a single release when testing.
1 parent c47dad6 commit 1488c64

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

docs/testing.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,14 @@ You can enable Elasticsearch tracing when running tests at the command line:
1212
ES_TRACE=1 ./bin/prove t/darkpan.t
1313

1414
You'll then find extensive logging information in `es.log`, at the top level of your Git checkout.
15+
16+
## Indexing a Single Release
17+
18+
If you want to speed up your debugging, you can index a solitary release using
19+
the `MC_RELEASE` environment variable.
20+
21+
MC_RELEASE=var/t/tmp/fakecpan/authors/id/L/LO/LOCAL/P-1.0.20.tar.gz ./bin/prove t/00_setup.t
22+
23+
Or combine this with a test specific to the release.
24+
25+
MC_RELEASE=var/t/tmp/fakecpan/authors/id/L/LO/LOCAL/P-1.0.20.tar.gz ./bin/prove t/00_setup.t t/release/p-1.0.20.t

t/lib/MetaCPAN/TestServer.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ sub index_releases {
167167
my $self = shift;
168168
my %args = @_;
169169

170-
local @ARGV = ( 'release', $self->_cpan_dir, );
170+
local @ARGV = ( 'release', $ENV{MC_RELEASE} ? $ENV{MC_RELEASE} : $self->_cpan_dir );
171171
ok(
172172
MetaCPAN::Script::Release->new_with_options( %{ $self->_config },
173173
%args )->run,

0 commit comments

Comments
 (0)