Skip to content

Commit

Permalink
Document e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
psrpinto committed Sep 21, 2023
1 parent 56072e8 commit 8f14a32
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 8 deletions.
10 changes: 2 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,8 @@ bin/prepare-release.sh 1.2.3

A new draft PR will now have been created, and its branch checked out locally.

### Test the release
You can use [`wp-env`](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-env/) to run a local WordPress instance with the plugin installed:

```shell
wp-env start
```

In your browser, navigate to the URL that `wp-env` wrote to the terminal and make sure that the plugin is working as expected.
### Run the tests
You must make sure tests pass before publishing a new release. See [End-to-end tests](tests/README.md) for instructions on running the tests.

### Add a Changelog
A Changelog must be added to the `Changelog` section of `README.md`. In the PR description, you can find a link to all the commits since the previous release. You should manually go through the list and identify merged PRs that should be included in the Changelog (i.e. PRs that result in user-facing changes).
Expand Down
32 changes: 32 additions & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# End-to-end tests

Running theses tests requires having [matrix-oidc-playground](https://github.com/Automattic/matrix-oidc-playground/) running in the same machine as the tests. Make sure to follow the setup instructions there before running the tests.

Once you have matrix-oidc-playground running, simply run:

```shell
composer test
```

The tests pass when the output ends with something like:


```shell
JWT token {
iss: 'https://localhost:8443/',
sub: 'admin',
aud: 'oidc-server-plugin-tests',
iat: 1695316090,
exp: 1695319690,
auth_time: 1695316090,
nonce: '7926217c4ad37e6db5cc8e6f78a421ed'
}
userinfo {
scope: 'openid profile',
username: 'admin',
name: 'admin',
nickname: 'admin',
picture: 'https://secure.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=96&d=mm&r=g',
sub: 'admin'
}
```

0 comments on commit 8f14a32

Please sign in to comment.