-
Notifications
You must be signed in to change notification settings - Fork 16
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
Fix(project): Fix Failing tests #317
Conversation
…dards Because * Python 3.12 has updated standards for hosting web servers, which need to be reflected in the current implementation. This commit * Refactors the web server setup in webserver.py to use modern Python 3.12 practices for better compatibility and reliability. Fixes mozilla#308
Because * The current webextension.xpi is outdated and incompatible with modern web extensions in Firefox. This commit * Recreates the XPI to ensure compatibility with the latest Firefox standards. The Manifest file is updated to version 3. Fixes mozilla#308
Can you fix the name of this PR as well as check the output from the checks. |
Because * The `origin` attribute is not defined on the `AddOnInstallBlocked` web element, and the `name` attribute only contains the origin host without the port. This commit * Updates `base.py` to check the `name` attribute for the host value in place of `origin`. * Modifies `test_notification_with_origin` to assert only the host value when comparing with the webserver, as the port cannot be retrieved from the web element. This might still require further revisions. Fixes mozilla#308
Thanks @b4handjr. The tests are now passing here. |
When you would like a review, please request one. Thanks. |
@b4handjr I would like to request a review for my PR. Could you please review my PR? I would appreciate it. |
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.
This is a good start, but I am trying to run this locally and I can't. I am having some DNS resolution errors. Could you provide a fix for this?
Here is the error
E selenium.common.exceptions.WebDriverException: Message: Reached error page: about:neterror?e=connectionFailure&u=http%3A//0.0.0.0%3A8000/&c=UTF-8&d=Firefox%20can%E2%80%99t%20establish%20a%20connection%20to%20the%20server%20at%200.0.0.0%3A8000.
E Stacktrace:
E RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8
E WebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:193:5
E UnknownError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:832:5
E checkReadyState@chrome://remote/content/marionette/navigate.sys.mjs:58:24
E onNavigation@chrome://remote/content/marionette/navigate.sys.mjs:344:39
E emit@resource://gre/modules/EventEmitter.sys.mjs:148:20
E receiveMessage@chrome://remote/content/marionette/actors/MarionetteEventsParent.sys.mjs:33:25
Thanks for pointing it out. I will review promptly. |
is this issue fixed? seems like a blocker to successfully fix other issues. |
Hi @b4handjr Here is my approach to fixing the problem. The error shows there is a DNS resolution issue when trying to access |
Because * DNS resolution errors can occur when running the web server locally, causing the server to fail in resolving hostnames. * Binding the web server to `127.0.0.1` resolves this issue by ensuring that the server listens only on the loopback address, preventing external DNS lookups. This commit * Modifies the `WebServer` class by adding a `get_free_port` method to dynamically assign ports. * The conftest.py now assigns `127.0.0.1` as a default port to the `WebServer` class. * Ensures that the server runs reliably in local development environments without requiring external DNS resolution. Fixes mozilla#308
You can try solving this as well, if you have an idea of how you think it should be done. |
Thanks, I will take a look. Also, your follow up commits don't need to be in the commit format for the PR, you can just leave a short message using |
I noticed your tests are passing on release firefox. This is probably because your web extension is signed. Did you get your webextension signed? I see this ID in your
|
Yeah, it is signed. I tried the unsigned one, the |
Yeah that is what I thought would happen. I guess for full functionality this is the ideal approach but we should notify people of this limitation within Firefox as it is hard to uncover. |
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.
Looking good, I was able to test this locally and saw it getting a new port each test run.
If no one else tries to fix this issue I will merge this in the next couple of days. |
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.
Thank you so much for this!
* refactor(project): Update webserver.py to align with Python 3.12 standards Because * Python 3.12 has updated standards for hosting web servers, which need to be reflected in the current implementation. This commit * Refactors the web server setup in webserver.py to use modern Python 3.12 practices for better compatibility and reliability. Fixes mozilla#308 * fix(project): Update XPI for modern Firefox compatibility Because * The current webextension.xpi is outdated and incompatible with modern web extensions in Firefox. This commit * Recreates the XPI to ensure compatibility with the latest Firefox standards. The Manifest file is updated to version 3. Fixes mozilla#308 * fix(base.py): Adjust origin handling for AddOnInstallBlocked Because * The `origin` attribute is not defined on the `AddOnInstallBlocked` web element, and the `name` attribute only contains the origin host without the port. This commit * Updates `base.py` to check the `name` attribute for the host value in place of `origin`. * Modifies `test_notification_with_origin` to assert only the host value when comparing with the webserver, as the port cannot be retrieved from the web element. This might still require further revisions. Fixes mozilla#308 * fix(project): Resolve DNS issues by binding to loopback address Because * DNS resolution errors can occur when running the web server locally, causing the server to fail in resolving hostnames. * Binding the web server to `127.0.0.1` resolves this issue by ensuring that the server listens only on the loopback address, preventing external DNS lookups. This commit * Modifies the `WebServer` class by adding a `get_free_port` method to dynamically assign ports. * The conftest.py now assigns `127.0.0.1` as a default port to the `WebServer` class. * Ensures that the server runs reliably in local development environments without requiring external DNS resolution. Fixes mozilla#308 * removed os module * eliminated custom translate_path
fix(project): Fix Failing tests
Because
origin
attribute is not defined on theAddOnInstallBlocked
web element, and thename
attribute only contains the origin host without the port.This commit
webserver.py
to use modern Python 3.12 practices for better compatibility and reliability.base.py
to check thename
attribute for the host value in place oforigin
.test_notification_with_origin
to assert only the host value when comparing with the webserver, as the port cannot be retrieved from the web element.Fixes #308