kazurayam / materialstore

A domain-specific file system to store "materials" (screenshots, HTML, JSON, XML) collected during End-to-End testings using Selenium WebDriver etc. Features to make "diff" and compiling HTML reports are also included. This is written in pure Java8
Apache License 2.0
0 stars 0 forks source link

IndexEntry of "category":"diff" should contain attributes that link to the Left JobTimestamp and the Right JobTimestamp #325

Closed kazurayam closed 2 years ago

kazurayam commented 2 years ago

derived from the issue #317

An sample "Index" of a Chronos mode diff:

store/CURA/20221023_144142

8aadc9cbce6e685e68c8794431d2f1670576a744    html    {"category":"diff", "left":"07730aaa0c4992dcddb58ef5281faec082c8a8ee", "ratio":"0.00%", "right":"07730aaa0c4992dcddb58ef5281faec082c8a8ee"}
87183eb44426f982b17936aecbc356a5011e49c9    html    {"category":"diff", "left":"50f8b3a683065e3094de8c659ee7b4d04778d231", "ratio":"0.90%", "right":"db8fd9d749793ae31c2730651de0d5f9aeaf4c84"}
ed52848efe00e1c9de40c1f1c5db96609fe0cae3    html    {"category":"diff", "left":"689564153a63013f5ddcb6e9a489b00cf9861b5b", "ratio":"1.87%", "right":"278cce659ac31591389e03471491aa5987b74722"}
732f53c66325b08fe9d9cb22a9be5f9a015bd117    png {"category":"diff", "left":"732f53c66325b08fe9d9cb22a9be5f9a015bd117", "ratio":"0.00%", "right":"732f53c66325b08fe9d9cb22a9be5f9a015bd117"}
9a13f644d8df0a2a8f1bfb2af51783716655c7f8    png {"category":"diff", "left":"9a13f644d8df0a2a8f1bfb2af51783716655c7f8", "ratio":"0.00%", "right":"9a13f644d8df0a2a8f1bfb2af51783716655c7f8"}
2a3769458516d9fd061ceb6a5d00e278abab0b4a    png {"category":"diff", "left":"a5789eff545c6017f9fa79d47487f67296b295c6", "ratio":"42.98%", "right":"5e5ea1b574aaa86642b331e66cd562cf72a38c68"}

I think this is not informative enough. I want to change this to:

8aadc9cbce6e685e68c8794431d2f1670576a744    html    {"category":"diff", "leftJobTimestamp":"20221023_143505", "left":"07730aaa0c4992dcddb58ef5281faec082c8a8ee", "ratio":"0.00%", "rightJobTimestamp":"20221023_144115", "right":"07730aaa0c4992dcddb58ef5281faec082c8a8ee"}
87183eb44426f982b17936aecbc356a5011e49c9    html    {"category":"diff", "leftJobTimestamp":"20221023_143505", "left":"50f8b3a683065e3094de8c659ee7b4d04778d231", "ratio":"0.90%", "rightJobTimestamp":"20221023_144115", "right":"db8fd9d749793ae31c2730651de0d5f9aeaf4c84"}
ed52848efe00e1c9de40c1f1c5db96609fe0cae3    html    {"category":"diff", "leftJobTimestamp":"20221023_143505", "left":"689564153a63013f5ddcb6e9a489b00cf9861b5b", "ratio":"1.87%", "rightJobTimestamp":"20221023_144115", "right":"278cce659ac31591389e03471491aa5987b74722"}
732f53c66325b08fe9d9cb22a9be5f9a015bd117    png {"category":"diff", "leftJobTimestamp":"20221023_143505", "left":"732f53c66325b08fe9d9cb22a9be5f9a015bd117", "ratio":"0.00%", "rightJobTimestamp":"20221023_144115", "right":"732f53c66325b08fe9d9cb22a9be5f9a015bd117"}
9a13f644d8df0a2a8f1bfb2af51783716655c7f8    png {"category":"diff", "leftJobTimestamp":"20221023_143505", "left":"9a13f644d8df0a2a8f1bfb2af51783716655c7f8", "ratio":"0.00%", "rightJobTimestamp":"20221023_144115", "right":"9a13f644d8df0a2a8f1bfb2af51783716655c7f8"}
2a3769458516d9fd061ceb6a5d00e278abab0b4a    png {"category":"diff", "leftJobTimestamp":"20221023_143505", "left":"a5789eff545c6017f9fa79d47487f67296b295c6", "ratio":"42.98%", "rightJobTimestamp":"20221023_144115", "right":"5e5ea1b574aaa86642b331e66cd562cf72a38c68"}

Please note that the latter index of store/CURA/20221023_144142 contains 2 new attributes in each lines:

Having these 2 attributes makes it possible to trace that the directory store/CURA/20221023_144142 is closely linked to 2 other directories.

As for #317, the restoring code can find which JobName/JobTimestamp directories are to be regarded as one unit, and hense is necessary to bring up and down together.

kazurayam commented 2 years ago

The following might be more concise, easier to understand:

8aadc9cbce6e685e68c8794431d2f1670576a744    html    {"category":"diff", "left":"20221023_143505/07730aaa0c4992dcddb58ef5281faec082c8a8ee", "ratio":"0.00%", "right":"20221023_144115/07730aaa0c4992dcddb58ef5281faec082c8a8ee"}
87183eb44426f982b17936aecbc356a5011e49c9    html    {"category":"diff", "left":"20221023_143505/50f8b3a683065e3094de8c659ee7b4d04778d231", "ratio":"0.90%", "right":"20221023_144115/db8fd9d749793ae31c2730651de0d5f9aeaf4c84"}
ed52848efe00e1c9de40c1f1c5db96609fe0cae3    html    {"category":"diff", "left":"20221023_143505/689564153a63013f5ddcb6e9a489b00cf9861b5b", "ratio":"1.87%", "right":"20221023_144115/278cce659ac31591389e03471491aa5987b74722"}
732f53c66325b08fe9d9cb22a9be5f9a015bd117    png {"category":"diff", "left":"20221023_143505/732f53c66325b08fe9d9cb22a9be5f9a015bd117", "ratio":"0.00%", "right":"20221023_144115/732f53c66325b08fe9d9cb22a9be5f9a015bd117"}
9a13f644d8df0a2a8f1bfb2af51783716655c7f8    png {"category":"diff", "left":"20221023_143505/9a13f644d8df0a2a8f1bfb2af51783716655c7f8", "ratio":"0.00%", "right":"20221023_144115/9a13f644d8df0a2a8f1bfb2af51783716655c7f8"}
2a3769458516d9fd061ceb6a5d00e278abab0b4a    png {"category":"diff", "left":"20221023_143505/a5789eff545c6017f9fa79d47487f67296b295c6", "ratio":"42.98%", "right":"20221023_144115/5e5ea1b574aaa86642b331e66cd562cf72a38c68"}
kazurayam commented 2 years ago

started working on this as 0.11.1-SNAPSHOT

kazurayam commented 2 years ago

"20221023_143505/07730aaa0c4992dcddb58ef5281faec082c8a8ee" --- I will name this value as MaterialLocator.

I will add a class com.kazurayam.materialstore.filesystem.MaterialLocator

kazurayam commented 2 years ago

I implemented MaterialLocator at v0.11.1-SNAPSHOT

It produced this:

f2141884ab5f4258ffb4c2f3a2fc6b86b36ffb54    html    {"category":"diff", "left":"20221023_144115/07730aaa0c4992dcddb58ef5281faec082c8a8ee", "ratio":"0.33%", "right":"20221023_193806/95e0e51143ef2c7379ce6fb1c3e78a03372be4c0"}
30fee0f6fbf3818d8b828a693c28b2a6d87d1c44    html    {"category":"diff", "left":"20221023_144115/278cce659ac31591389e03471491aa5987b74722", "ratio":"1.87%", "right":"20221023_193806/ca33f3f8b9d77e7db8d168b8025e89b4c551314f"}
2cf50cd07f424b8fa83d935ca913c89800b32aac    png {"category":"diff", "left":"20221023_144115/5e5ea1b574aaa86642b331e66cd562cf72a38c68", "ratio":"43.54%", "right":"20221023_193806/96aa85db313791a7949dac35efadfc2631a24679"}
732f53c66325b08fe9d9cb22a9be5f9a015bd117    png {"category":"diff", "left":"20221023_144115/732f53c66325b08fe9d9cb22a9be5f9a015bd117", "ratio":"0.00%", "right":"20221023_193806/732f53c66325b08fe9d9cb22a9be5f9a015bd117"}
9a13f644d8df0a2a8f1bfb2af51783716655c7f8    png {"category":"diff", "left":"20221023_144115/9a13f644d8df0a2a8f1bfb2af51783716655c7f8", "ratio":"0.00%", "right":"20221023_193806/9a13f644d8df0a2a8f1bfb2af51783716655c7f8"}
f5e56f863b752c69cf8ae48779d4fe4502cb3330    html    {"category":"diff", "left":"20221023_144115/db8fd9d749793ae31c2730651de0d5f9aeaf4c84", "ratio":"0.90%", "right":"20221023_193806/1cdb1c2d77918ff3dcbc54b9344cc7f15919ec9e"}

This looks OK.

kazurayam commented 2 years ago

done at ver 0.11.1-SNAPSHOT