eo icon indicating copy to clipboard operation
eo copied to clipboard

Make HashOfTag testable without accessing web

Open mximp opened this issue 1 year ago • 6 comments

We need to be able to populate tags with custom values rather than always download it from the web.

mximp avatar Sep 05 '22 11:09 mximp

@mximp it's hard to imagine how we can make it testable alone, since it's used in PullMojo by new. Maybe it's better to introduce new option for PullMojo, something like: -DofflineHash=*.*.*:a1b2c3d. Here, *.*.* means "for any version" and a1b2c3d is the version that it has to return. Then, we just create a fake implementation of HashOfTag, which is created if this offlineHash option is provided, and used instead of a regular HashOfTag. WDYT?

yegor256 avatar Sep 05 '22 13:09 yegor256

@yegor256 great idea. The only thing I would make this property to contain a list of such mappings: -DofflineHash="0.2.7:abc2sd3,0.2.8:s4se2fe" so that we can simulate any content of tags.txt. Or even make this property to be a file path for custom tags file.

mximp avatar Sep 05 '22 14:09 mximp

@mximp yes, a list sounds like a good idea. A file too:

"-DofflineHash=0.*.*:abc2sd3"
"-DofflineHash=0.2.7:abc2sd3,0.2.8:s4se2fe"
"-DofflineHashFile=hello.tags"

yegor256 avatar Sep 05 '22 14:09 yegor256

@mximp I suggest assigning this to someone

yegor256 avatar Sep 05 '22 14:09 yegor256

@Nypiaka please assist with the implementation

mximp avatar Sep 05 '22 14:09 mximp

@yasamprom please assist

mximp avatar Sep 23 '22 08:09 mximp

@volodya-lombrozo please take this.

mximp avatar Oct 25 '22 08:10 mximp

@mximp the puzzle #1374 is still not solved.

0pdd avatar Oct 28 '22 08:10 0pdd

@mximp 3 puzzles #1374, #1381, #1382 are still not solved.

0pdd avatar Oct 31 '22 11:10 0pdd

@mximp 4 puzzles #1374, #1381, #1382, #1387 are still not solved.

0pdd avatar Nov 01 '22 12:11 0pdd

@mximp 3 puzzles #1374, #1381, #1382 are still not solved; solved: #1387.

0pdd avatar Nov 01 '22 15:11 0pdd

@mximp 3 puzzles #1374, #1381, #1397 are still not solved; solved: #1382, #1387.

0pdd avatar Nov 02 '22 16:11 0pdd

@mximp 2 puzzles #1374, #1412 are still not solved; solved: #1381, #1382, #1387, #1397.

0pdd avatar Nov 07 '22 08:11 0pdd

@mximp the puzzle #1374 is still not solved; solved: #1381, #1382, #1387, #1397, #1412.

0pdd avatar Nov 07 '22 09:11 0pdd

@mximp all 6 puzzles are solved here: #1374, #1381, #1382, #1387, #1397, #1412.

0pdd avatar Nov 09 '22 13:11 0pdd

@mximp we can close it

volodya-lombrozo avatar Nov 09 '22 13:11 volodya-lombrozo