Problem/Motivation

Create a test fixture that contains data for ~20 projects that can be used for tests so we don't have to rely on an API that could change.

Steps to reproduce

Proposed resolution

Remaining tasks

  • ✅ File an issue about this project
  • ☐ Addition/Change/Update/Fix to this project
  • ☐ Testing to ensure no regression
  • ☐ Automated unit/functional testing coverage
  • ☐ Developer Documentation support on feature change/addition
  • ☐ User Guide Documentation support on feature change/addition
  • ☐ Code review from 1 Drupal core team member
  • ☐ Full testing and approval
  • ☐ Credit contributors
  • ☐ Review with the product owner
  • ☐ Release

User interface changes

API changes

Data model changes

Release notes snippet

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

hooroomoo created an issue. See original summary.

fjgarlin’s picture

fjgarlin’s picture

Added a RandomDataPlugin, which generates totally random data in the format that we expect. It ignores the filters to query projects and returns a new set of random projects, so the front-end should remain fully functional.

Note that this depends on some of the changes done in the related issue https://www.drupal.org/project/project_browser/issues/3280176, as the current front-end is tied to the Mock.

Once the related issues gets merged, we can safely merge this one too.

hooroomoo’s picture

Assigned: hooroomoo » Unassigned
Status: Active » Needs review

Test fixture is 25 projects which is laid out below to be able to test a wide range of sorting/filtering options. Each fake project also has either 0, 1, 2, 3 tags (taxonomy_vocabulary_3) associated with it and different "changed" and "created" values.

12 Under Active Development (7 security covered, 5 not covered)
- 3 Actively Maintained
- 3 Minimally Maintained
- 2 Seeking New Maintainer
- 2 Seeking Co-maintainer
- 2 Unsupported

6 Maintenance Fixes Only (3 covered, 3 not covered)
- 2 Actively Maintained
- 1 Seeking New Maintainer
- 1 Unsupported
- 2 Seeking Co-maintainer

4 No Further Development (2 covered, 2 not covered)
- 1 Actively Maintained
- 1 Minimally Maintained
- 2 Unsupported

3 Obsolete ( 2 covered, 1 not covered)
- 1 Unsupported
- 2 Minimally Maintained

narendrar’s picture

Status: Needs review » Needs work
fjgarlin’s picture

@hooroomoo - can you see the feedback from @narendraR. I guess it's probably a copy/paste issue but I'll let you have a look in any case. I'm happy to clean it up if needed, I just don't know yet where or how that file will be used.

hooroomoo’s picture

Status: Needs work » Needs review

tim.plunkett made their first commit to this issue’s fork.

tim.plunkett’s picture

Assigned: Unassigned » tim.plunkett

Thanks @narendraR! Working on this more

tim.plunkett’s picture

Assigned: tim.plunkett » Unassigned
Status: Needs review » Needs work

I think all we're missing now is two more test methods: one for using the module categories, one for the advanced filtering. See the one I included for testing the pager for inspiration
Sorting should be handled in #3277260: Update and move sort criteria

Unassigning myself for now

hooroomoo’s picture

Assigned: Unassigned » hooroomoo
hooroomoo’s picture

Status: Needs work » Active
hooroomoo’s picture

Status: Active » Needs review
hooroomoo’s picture

Found a bug while working on this with category filtering. Filed #3281252: Category filter allows duplicates. The category filtering test should be added as a part of that bug issue since it's partly broken right now and after this test fixture is in.

tim.plunkett’s picture

Assigned: hooroomoo » Unassigned

Awesome, thanks @hooroomoo. Agreed on splitting that out to another issue, what we have here is good.

fjgarlin’s picture

The code looks good and the tests are running, plus they are a great foundation for more tests!

The only thing I miss is some comment saying that it’s using the MockApi, or a line like this $this->config('project_browser.admin_settings')->set('enabled_source', 'drupalorg_mockapi')->save(TRUE); in the test to make it more obvious.

Perhaps that line could go here: https://git.drupalcode.org/project/project_browser/-/blob/0c9464a3fd141f...

fjgarlin’s picture

Status: Needs review » Needs work
hooroomoo’s picture

Status: Needs work » Needs review
fjgarlin’s picture

Status: Needs review » Reviewed & tested by the community

Code looks good and tests (including the new ones) are green. RTBC. Great work!

tim.plunkett’s picture

Rebased (multiple merge commits in here) and fixed the @see to point to a function, not a file. Will merge shortly.

tim.plunkett’s picture

Status: Reviewed & tested by the community » Fixed

Merged!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.