Skip to content

Conversation

@rjbs
Copy link
Collaborator

@rjbs rjbs commented May 11, 2024

This doesn't just add tests, it adds some nice little helpers for writing tests. I'm writing these tests to benefit the PAUSE::Indexer::Context branch.

Copy link
Collaborator

@wolfsage wolfsage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bunch of nits and questions, but seems good!

This commit has a spelling error: indexer tests: more converstion to assert_index_updated

converstion -> conversion

@rjbs rjbs force-pushed the indexer-perl-tests branch from 280532c to 54bb99c Compare May 19, 2024 21:52
@rjbs rjbs requested a review from wolfsage May 19, 2024 21:52
@rjbs rjbs force-pushed the indexer-perl-tests branch from 54bb99c to 8ce0780 Compare May 19, 2024 21:53
rjbs added 18 commits May 19, 2024 18:45
The previous method for checking this was generic, which is nice, but
sort of verbose to use.  Worse, though, I don't think it was reliable.
That code, ->file_updated_ok and ->file_not_updated_ok, worked by
keeping a cache of file stats -- but it didn't precompute those stats,
it computed them on demand.  So given this program:

  $pause = PAUSE::TestPause->new;

  do_stuff();
  my $r1 = $pause->test_reindex;
  do_other_stuff();
  $pause->file_updated_ok("A");
  my $r2 = $pause->test_reindex;
  do_more_stuff();
  my $r3 = $pause->test_reindex;

Calling `->file_updated_ok("A")` at the end would test since the
previous call.  Calling `->file_updated_ok("B")` at the end would test
starting from nothing.

In reality, we only use this method for tracking 02packages, so I've
added specific tracking of that file, with the check put onto the Result
object, considering only what changed in the `test_reindex` call that
created that Result.
...and add methods to check or print them.
(Specificaly: it is perl-like, not unauthorized real perl.)
That is: a new relase of perl-5, even if it contains a higher version of
some dual-life package, should not replace the old package in the index,
if it comes from a non-perl distribution.
@rjbs rjbs force-pushed the indexer-perl-tests branch from 8ce0780 to 2e9327b Compare May 19, 2024 22:45
Copy link
Collaborator

@wolfsage wolfsage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@rjbs rjbs merged commit 9011400 into andk:master May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

indexer How we index uploads

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants