[MGNLIMG-152] Consistency in how test images are generated, stored and kept (or not) for inspection Created: 13/Mar/15  Updated: 19/May/22  Resolved: 19/May/22

Status: Closed
Project: Imaging
Component/s: None
Affects Version/s: None
Fix Version/s: 3.2.x

Type: Improvement Priority: Neutral
Reporter: Magnolia International Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
relation
is related to MGNLIMG-114 Tests should output test images in th... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:

 Description   

We have info.magnolia.imaging.AbstractImagingTest#KEEP_GENERATED_FILES_FOR_INSPECTION, but some test methods bypass it: AbstractImagingTest#write() method use it, but tests using AbstractImagingTest#newOutputFile() directly do not.
We should probably:

  • ensure consistency (although some generated images are probably never meant to be manually inspected, so maybe we need a flag of sorts)
  • simplify output methods (there are too many for test developers to choose from)
  • make that flag changeable without modifying code (perhaps a profile in the build)


 Comments   
Comment by Magnolia International [ 13/Mar/15 ]

I had to fix this in part for MGNLIMG-114; now both write() and newOutputFile() methods take care of the flag.
It's still not changeable without touching code.
For reference below, a piece of ugly code that could have helped if we really needed to check if we're running in Clover.
A better solution would be to gain better control on the lifecycle of the test suites and create the generated-test-output folders once and for all (so we could possibly create it just once at the beginning of the test-run, with a unique name)

if (isRunningClover()) {
    outputDir += "-clover";
}
private static boolean isRunningClover() {
    try {
        Class.forName("com_atlassian_clover.Clover");
        return true;
    } catch (Throwable e) {
        return false;
    }
}
Comment by Roman Kovařík [ 19/May/22 ]

Hello,

This ticket is now marked as closed due to one of the following reasons:

  • A long period of inactivity
  • Uses an old or Beta version of an application, module, or framework that we no longer support
  • The issue is no longer reproducible or has been fixed in later versions

If you are still facing a problem or consider this issue still relevant, please feel free to re-open the ticket and we will reach out to you.

Thank you,
The Magnolia Team

Generated at Mon Feb 12 02:12:48 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.