Closed Bajger closed 2 years ago
@demarey: Let me know, which option you'd like better. Quick way is to remove sources.list
@Bajger I think the best option would be to use our own sources.list file for testing. That way, sources will not change from time to time leading to CI errors. In the setup, I would force the copy of our own sources.list file (with only a a few categories and entries with different kind) to the specified location, or better, configure an alternate location of sources file for the execution of the test (the previous one being restored at the end of the test) that will point to the test sources.list file.
@demarey: Is it ok this approach? I don't know if we can force launcher execution to use "own" sources list from different than expected directory (therefore to use backup dir).
PhLTemplateSources launcherCoreDir: (FileLocator workingDirectory / 'test') asFileReference
.PhLTemplateSources launcherCoreDir: FileLocator launcherUserFilesLocation
.@demarey : Ok, but how would you set 3) and 4) during a shell test (without modifying original image)? Shell unit tests just invoke production commands (not test specific). I'm not sure when and where these snippets should be executed (e.g. something ./pharo-launcher eval code-snippet?).
yes, David, you're right. I forgot you are doing black-box testing. In this case, the best would be to copy your sources file for testing at the default location in the setup and remove it in the teardown.
@demarey : Found that rewriting sources.list file is not enough :( If I use own file, refresh on template repository must be invoked. Otherwise cache with templates becomes somehow invalid and I have error during template lookup: "Official distributions not found, please enter a correct category name". Probably some check, if sources.list file was changed so template repository should be updated? Its becoming more complicated... I don't know if it is worth to change logic of core pharo launcher in this way. Probably it simpler to just delete sources file (if file is missing, it downloads and refreshes template repository). WDYT?
This is modified sources.list file for testing purposes (deleted most of contents). Maybe there is something wrong here:
OrderedCollection [
PhLTemplateSource {
#type : #Cache,
#name : 'Templates'
},
PhLTemplateSource {
#type : #URLGroup,
#name : 'Official distributions',
#templates : [
PhLTemplateSource {
#type : #URL,
#name : 'Pharo 11.0 - 64bit (development version, latest)',
#url : 'https://files.pharo.org/image/110/latest-64.zip'
},
PhLTemplateSource {
#type : #URL,
#name : 'Pharo 11.0 - 32bit (development version, latest)',
#url : 'https://files.pharo.org/image/110/latest-32.zip'
},(stable)
PhLTemplateSource {
#type : #URL,
#name : 'Pharo 10.0 - 64bit (stable)',
#url : 'https://files.pharo.org/image/100/latest-64.zip'
},
PhLTemplateSource {
#type : #URL,
#name : 'Pharo 10.0 - 32bit (stable)',
#url : 'https://files.pharo.org/image/100/latest-32.zip'
},
PhLTemplateSource {
#type : #URL,
#name : 'Pharo 9.0 - 64bit (old stable)',
#url : 'https://files.pharo.org/image/90/stable-64.zip'
},
PhLTemplateSource {
#type : #URL,
#name : 'Pharo 9.0 - 32bit (old stable)',
#url : 'https://files.pharo.org/image/90/stable-32.zip'
}
],
#expanded : true
},
PhLTemplateSource {
#type : #HttpListing,
#name : 'Pharo 10.0 (stable)',
#url : 'https://files.pharo.org/image/100/',
#filterPattern : 'href="(Pharo-?10-SNAPSHOT.build.[^"]*.zip)"'
},
PhLTemplateSource {
#type : #HttpListing,
#name : 'Pharo 11.0 (development version)',
#url : 'https://files.pharo.org/image/110/',
#filterPattern : 'href="(Pharo-?11-SNAPSHOT.build.[^"]*.zip)"'
}
]
Describe the bug CI job fails due to falining shell unit tests as part of Jenkins job on branch feature/cmd-line.
To Reproduce Steps to reproduce the behavior:
Expected behavior Shell unit tests pass.
Version information:
Additional context Error occurs due to fact that template list is outdated and image template for P10 stable is not found.