Skip to content

Test for #614 - #903

Open
D-Groenewegen wants to merge 8 commits into
SemanticMediaWiki:masterfrom
D-Groenewegen:patch-incoming
Open

Test for #614#903
D-Groenewegen wants to merge 8 commits into
SemanticMediaWiki:masterfrom
D-Groenewegen:patch-incoming

Conversation

@D-Groenewegen

Copy link
Copy Markdown
Contributor

Adds a JSONScript test file for the incoming format, focusing for now on #614.

D-Groenewegen and others added 4 commits January 29, 2025 22:12
Revised and simplified:
- Discarded a use case that was both elaborate and probably set up wrong. If we want to test template output, a second file (incoming-02) would be more appropriate.
- Covered two issues separately (SemanticMediaWiki#614 and SemanticMediaWiki#984).
Updated JSONScript test cases to remove div elements and adjust query formats. I do wonder if 'incoming' is at all enabled in the integration tests.
@D-Groenewegen

Copy link
Copy Markdown
Contributor Author

Interestingly, ({{#ask: [[Example/SRF0614/D.1]] |mainlabel=- |link=none |format=incoming |limit=999 |sep=; }}), where Example/SRF0614/D.1 receives incoming properties from two different pages, produces an empty an empty string.

==== (actual) ====
<div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr"><p>()
</p></div>
==== (StringContains expected) ====
[ (Is related to;Not to be confused with) ]

Failed asserting that 0 matches expected 1.

/var/www/html/extensions/SemanticMediaWiki/tests/phpunit/Utils/Validators/StringValidator.php:76
/var/www/html/extensions/SemanticMediaWiki/tests/phpunit/Utils/Validators/StringValidator.php:31
/var/www/html/extensions/SemanticMediaWiki/tests/phpunit/Utils/JSONScript/QueryTestCaseProcessor.php:241
/var/www/html/extensions/SemanticMediaWiki/tests/phpunit/JSONScriptServicesTestCaseRunner.php:503
/var/www/html/extensions/SemanticMediaWiki/tests/phpunit/JSONScriptServicesTestCaseRunner.php:442
/var/www/html/extensions/SemanticMediaWiki/tests/phpunit/JSONScriptServicesTestCaseRunner.php:144
/var/www/html/extensions/SemanticMediaWiki/tests/phpunit/JSONScriptTestCaseRunner.php:196

A previous version, without mainlabel=- and link=none, returns the page. Something tells me the incoming format is not enabled on the test wiki. Will now set srfgFormats explicitly.

Maybe use object structure with "append" instead of "srfgFormats[]"?
object structure with append not working
@D-Groenewegen

D-Groenewegen commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

I give up. @gesinn-it-gea, I was hoping you'd be able to tell what's wrong with the integration test. It looks like either the incoming format refuses to be enabled, in spite of the explicit settings, or there may be other reasons why the query is simply not able to pick up incoming semantic data.

[Edit - 9 July] Looks like the solution will be #1117, which needs to be merged first.

@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.84%. Comparing base (bba4e5e) to head (1472dd2).

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #903      +/-   ##
============================================
+ Coverage     58.38%   58.84%   +0.45%     
  Complexity     2469     2469              
============================================
  Files           129      129              
  Lines         11828    11828              
  Branches        473      473              
============================================
+ Hits           6906     6960      +54     
+ Misses         4577     4523      -54     
  Partials        345      345              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Successfully merging this pull request may close these issues.

2 participants