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 test
step, 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-type
file that normally appears in a location like/opt/Zui/resources/package-type
when running a packaged version of the app, but theprocess.resourcesPath
that's used to build that path has beenundefined
when running our Jest tests. Just the act of importingautoUpdater
and making those config settings shown above is enough to trigger this code that looks for thepackage-type
file, hence why it it lands in thecatch
block and prints the warning.A clean fix might be to make
electron-updater
smarter about bailing early whenprocess.resourcesPath
isundefined
. However, I had challenges when trying to test with a modifiedelectron-updater
in a fork repo, so @jameskerr suggested we just make it happy by supplying this dummy value soelectron-updater
will bail cleanly when it finds the path does not exist on the next line.