-
Notifications
You must be signed in to change notification settings - Fork 119
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
Addon testing suite #5058
Addon testing suite #5058
Conversation
46881f9
to
a7eb906
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some initial comments. I need to give this another pass later, it's dense. Overall I like the way we are going. This is a great improvement for addon testing capabilities!
Codecov ReportBase: 25.70% // Head: 28.26% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #5058 +/- ##
==========================================
+ Coverage 25.70% 28.26% +2.56%
==========================================
Files 12 255 +243
Lines 607 14970 +14363
Branches 325 8567 +8242
==========================================
+ Hits 156 4231 +4075
- Misses 262 4251 +3989
- Partials 189 6488 +6299
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I get it now. I like how clean the addon functional tests are looking 💯 Left just a few more nits and questions. Otherwise this is looking good.
assert(await vpn.isFeatureFlippedOff('addonSignature')); | ||
} | ||
it('Empty addon index', async () => { | ||
await vpn.resetAddons('01_empty_manifest'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think it would be better if we reset to the empty manifest on the beforeEach
block everytime and then in the test cases we defaulted to fetchAddons
. IIUC right now it is necessary to call reset as the first thing in each test case in order not to leak state from one test to the next. Is that correct? WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we even do that for ALL tests so that addon changes are never leaked no matter what people do? Not sure there a global beforeEach block, if not just ignore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the end of any test we call hardReset()
that deletes all the settings.
tests/functional/helper.js
Outdated
json.type === 'reset_addons' && !('error' in json), | ||
`Command failed: ${json.error}`); | ||
|
||
await this.waitForCondition(async () => this.lastAddonLoadingCompleted()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused. Does the _writeCommand('reset_addons')
end up having connect
called again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no. _writeCommand()
writes something on a established connected channel (websocket for functional tests, wasm JS for wasm).
This is a way to test addons in functional tests. It works this way:
tests/functional/addons
we create a folder for each "scenarios" we want to expose. We can expose a manifest.json directly, or a few folders, one for each addon.I migrated all the tests and I wrote a few more. But we can do more! Here is the list to start: