Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Run the Thunderbird test harness as a Github Action

License

Notifications You must be signed in to change notification settings

kewisch/action-thunderbird-tests

Repository files navigation

Thunderbird Tests Action

Discontinuation Notice

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.

Intro

Build Status

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.

Configuration

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.

Running locally

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.

About

Run the Thunderbird test harness as a Github Action

Resources

License

Stars

Watchers

Forks

Packages

No packages published