-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement unit testing and continuous integration #365
Comments
As discussed, @sophieeng will take the lead on unit testing and continuous integration. This is a more of an experimental phase at the moment. What technologies do we use, how do they work, how do they integrate with GitHub, ...? So, @sophieeng, feel free to practically explore and write one unit test, for example, to see how it works. |
Some notes about Unit Testing. I think Jest is still the best framework to use from what I've read online. The second recommended Javascript testing framework is Mocha, which is an older program. Jest seems to be the most recommended and popular to use. I am going to start playing around with Jest and if I can run a test. |
Great! Jest goes back to a suggestion by @lr-brown. Both @lr-brown and @jjeancharles are working on unit testing and CI for Privacy Pioneer. So, if it is helpful, please sync expertise, discuss challenges, etc. |
As discussed, @sophieeng will start a test folder, start compiling a list of features to test, and implement a few tests. |
An ongoing list of features to test, starting using Oliver's list from issue #289. Below is a rudimentary checklist of things to verify concerning the functionality of optmeowt.
Firefox:
|
One important limitation (of any/most unit testing frameworks) is that we cannot test the UI fully. For example, if there is a pure display issue, e.g., a string is correctly put into the UI but for whatever reason is displayed incorrectly, we can test the correctness of the string but not how it is actually displayed. Just as a note. |
An update before the weekly meeting: I have a working test that is giving what I expect, but there are still bugs I'm trying to smooth out before I push the changes as an example unit test. The bug is about importing and exporting between modules, currently messing with Jest configuration and am planning on messaging Logan. Things I'm thinking about: does browser matter? Like do firefox and chrome need different test, especially for Analysis mode which is only for ff. |
If there are differences in implementation, we could think about different tests. However, at this point let's keep it simple and just add some tests for the analysis mode for Firefox. Other than that Chromium browsers and Firefox can have the same test set. |
@sophieeng, here is part of @lr-brown's implementation. |
@sophieeng, let's also add a shield in the readme to give the status on whether the tests are passing (as in Privacy Pioneer). That way, we immediately can spot a problem. @lr-brown has info on how to do it. |
The next steps for unit testing are adding the shield and then creating a list of issues for the test suite. |
Nice work, @sophieeng! |
As discussed, once @sophieeng has finalized the documentation in the readme, @katehausladen will write a new test. This will help us to make sure that the documentation is clear. The test can come from the test suite above. |
I am closing this issue and separating it into smaller ones. The ReadMe changes will be published in #380. Kate's test following the ReadMe is in #391. The testing architecture is in #390. The core tests are in #392. All the code in this issue is referring to Jest, a testing framework we are not using, so I will not be pushing anything to main. |
As we seem to break functionality frequently upon code changes, we should implement (1) unit testing and (2) continuous integration (CI).
The basic idea is to come up with a fairly comprehensive list of features to test (e.g., third party domain display, USP API properly recognized before sending GPC signal, after sending GPC signal), write unit test(s) for each of these features, and run CI every time new code is merged into the main branch.
Here is a tutorial on Jest and GitHub Actions, which may be a good choice for the job.
This is a long-term effort that we can do over the winter break (or earlier if someone has time).
The text was updated successfully, but these errors were encountered: