Set process.resourcesPath to quiet electron-updater during Linux tests #3097
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since the merge of #3084, I've noticed that in the "Zui CI" Actions workflow on the Ubuntu runner there's warnings in the
yarn teststep, such as those in this recent run:I dug into this and found the root cause to be this line from the "beta" support for Linux auto-update added in electron-userland/electron-builder#7060. It looks for this
package-typefile that normally appears in a location like/opt/Zui/resources/package-typewhen running a packaged version of the app, but theprocess.resourcesPaththat's used to build that path has beenundefinedwhen running our Jest tests. Just the act of importingautoUpdaterand making those config settings shown above is enough to trigger this code that looks for thepackage-typefile, hence why it it lands in thecatchblock and prints the warning.A clean fix might be to make
electron-updatersmarter about bailing early whenprocess.resourcesPathisundefined. However, I had challenges when trying to test with a modifiedelectron-updaterin a fork repo, so @jameskerr suggested we just make it happy by supplying this dummy value soelectron-updaterwill bail cleanly when it finds the path does not exist on the next line.