diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2024-11-21 15:48:24 +0100 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2024-11-26 10:54:24 +0100 |
| commit | d6987c06f48b61352289181954f5a436c5f2379f (patch) | |
| tree | c1bfd0e08480fbb083db54d81d16ba1330d9e3af /docs/md/testing.md | |
| parent | b701d19e8b8b45226f6cb1090dd160eea989ca7e (diff) | |
Docs: Move to Mkdocs & Codeberg pages
Diffstat (limited to 'docs/md/testing.md')
| -rw-r--r-- | docs/md/testing.md | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/docs/md/testing.md b/docs/md/testing.md new file mode 100644 index 0000000..5e85131 --- /dev/null +++ b/docs/md/testing.md @@ -0,0 +1,27 @@ +# Testing +The Go library right now has various tests defined. E.g. server interaction, oauth, discovery and signature verification tests. + +To run the Go test suite, issue the following command in a shell + +```bash +make test +``` + +Note that this runs the tests without any server interaction (so for now only the signature verification tests). To run the tests with an eduVPN server you need to specify environment variables: + +```bash +SERVER_URI="eduvpn.example.com" PORTAL_USER="example" PORTAL_PASS="example" make test +``` + +This needs [python3-selenium](https://selenium-python.readthedocs.io/) and [geckodriver](https://github.com/mozilla/geckodriver/releases) (extract and put in your `$PATH`). Note that testing with a server assumes it uses a default portal, due to it needing to click on buttons on the web page. You can add your own portal by customizing the [called Selenium script](https://codeberg.org/eduVPN/eduvpn-common/src/branch/main/selenium_eduvpn.py). + +There are other environment variables that can be used: + +- `OAUTH_EXPIRED_TTL`: Use this for a server which has a low OAuth access token expiry time, e.g. 10 seconds. You would then set this variable to `"10"` so that a test is ran which waits for 10 seconds for the OAuth tokens to expire + +## Testing the Python code +To test the Python code, issue the following command in a shell (you will need dependencies for all wrappers if you do this[^1]): + +```bash +make -C wrappers/python test +``` |
