This action was written to run xpcshell tests for Thunderbird add-ons, but that will only be useful for legacy add-ons that interact directly with Thunderbird. The new and improved way to write Thunderbird add-ons is with the WebExtensions API, where unit testing can happen with jest, and UI tests can happen with webdriver. You might also like https://github.com/kewisch/action-web-ext/ which helps with linting and signing.
This is a Github Action to run Thunderbird tests, for example if you want to create an xpcshell test for your add-on. It makes use of the test packages generated by Thunderbird itself.
Supplying the GITHUB_TOKEN is neccessary to create annotations for the commit to show where tests failed.
The following config runs xpcshell tests using the manifest from test/xpcshell/xpcshell.ini
from
within your repository. It makes sure Lightning is enabled and uses the nightly channel (both
default config options)
test:
name: "Tests"
runs-on: ubuntu-latest
needs: build
steps:
- name: "Checkout"
uses: actions/checkout@v1
- name: "Run Tests"
uses: kewisch/action-thunderbird-tests@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
lightning: true
channel: nightly
xpcshell: test/xpcshell/xpcshell.ini
xpcshell is currently the only supported test harness, though support for mochitests or mozharness could be viable.
If you don't pass the token
it should still work, but no check runs will be created.
The package provides a binary that can be run locally. You could add the following to your package.json:
"scripts": {
"test": "action-thunderbird-tests test/xpcshell/xpcshell.ini",
}
Running npm test
will then run the Thunderbird tests. Be sure to run this in the base directory of
your package. Most configuration will be inferred, but you can check out the help options in case
you want to customize.