Skip to content

msautotest: Fix interpretation of test output comparison in mstestlib - #7249

Merged
geographika merged 1 commit into
MapServer:mainfrom
PPazderski:bugfix-msautotest-compareResult
Mar 6, 2025
Merged

geographika merged 1 commit into
MapServer:mainfrom
PPazderski:bugfix-msautotest-compareResult

Conversation

@PPazderski

Copy link
Copy Markdown
Contributor

The recent change 64a706f introduced a severe regression on msautotest.

At the moment it would not detect changes in test output in many cases. You can test this by changing any textual expected result file.
For example take msautotest/config/expected/missing_conf.txt, rewrite the expected error message, run the test and see how it still succeed.

The issue is how the comparison result is currently interpreted

if cmp != "match":
if not keep_pass:
os.remove("result/" + out_file)
if not quiet:
print(" results do not match, but ignored.")
else:
sys.stdout.write(".")
sys.stdout.flush()
return True, None
if cmp == "match":
if not keep_pass:
os.remove("result/" + out_file)
if not quiet:
print(" results match.")
else:
sys.stdout.write(".")
sys.stdout.flush()

With the removal of the extra ignore_comparison_result parameter the first if block is always considered. The compare result is either == "match" and the test successful or != "match" and the difference ignored and the test also succesful.

Right now there is no way to enter any of the other elif blocks.

This fixes a regression from 64a706f were a
feature to skip some differences in test output was incompletely removed.
Before this fix it will skip all non-matching results and report them as success.
@jmckenna

jmckenna commented Mar 5, 2025

Copy link
Copy Markdown
Member

great catch @PPazderski !

@geographika

Copy link
Copy Markdown
Member

@PPazderski - thanks for spotting this. Many of the images match, but have different binary representations, so it looks like the vagrant and Docker outputs aren't identical (possibly due to slightly different configurations).
There are still ~20 failing tests I didn't catch though that will need to be addressed. I'll merge this and look at skipping the remaining failures until there is time to address them.

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.

3 participants