Skip to content

Add parser tests #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JeroenDeDauw opened this issue Nov 7, 2023 · 0 comments
Closed

Add parser tests #5

JeroenDeDauw opened this issue Nov 7, 2023 · 0 comments
Assignees

Comments

@JeroenDeDauw
Copy link
Member

AC: we have a passing parser test that tests our lua integration

This parser test will need to create a Module:Whatever page in its setup and then invoke that lua module.

The test could use the real SPARQL endpoint, in which case it's fine if it only works locally, and is skipped on GitHub Actions. OR, the SPARQL request can be intercepted by a test double, since that part is already tested via #4. We do not have a good example of such mocking available and also ran into this challenge at ProfessionalWiki/ExternalContent#52. We'd need to override some MediaWiki services, presumably via the MediaWikiServices class, and only do so during tests. The ParserTestGlobals hook might be a good place to do so (see also https://github.com/ProfessionalWiki/ExternalContent/blob/master/src/EntryPoints/MediaWikiHooks.php#L54).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants