Skip to content

Commit

Permalink
schek/update_licenses_data (#1073)
Browse files Browse the repository at this point in the history
* schek/update_licenses_data

* add update for reviewer tools, coverage and api

* update fe

* update

* removed api until fix

* from commit workflow as well

* update devhub page

* update devhub page

* replace wait

* remove wait

* change order
  • Loading branch information
alexandruschek authored Dec 12, 2024
1 parent c19e222 commit fa2a39b
Show file tree
Hide file tree
Showing 23 changed files with 3,399 additions and 82 deletions.
Binary file modified .DS_Store
Binary file not shown.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ workflows:
- ratings_serial_tests
- devhub_parallel_tests
- addon_submissions_tests
- api_submission_tests
# - api_submission_tests

# scheduled in CircleCI Project settings to run each Wednesdays at 04:00 UTC
scheduled_coverage_run:
Expand Down Expand Up @@ -660,7 +660,7 @@ workflows:
- frontend_parallel_tests
- devhub_parallel_tests
- addon_submissions_tests
- api_submission_tests
# - api_submission_tests
# scheduled in CircleCI Project settings to start each Thursdays at 17:00 UTC
scheduled_prod_sanity_run:
when:
Expand Down
2 changes: 1 addition & 1 deletion api/payloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def listed_addon_details(uuid):
def new_version_details(uuid):
body = {
"upload": uuid,
"license": "GPL-2.0-or-later",
"license": "ISC",
"release_notes": {
"de": "New Version DE notes added in API at addon creation time",
"en-US": "New Version EN-US notes added in API at addon creation time",
Expand Down
2,636 changes: 2,630 additions & 6 deletions api_submission_tests.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions api_user.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1q54895qe7ferg1iwsoioxaxrwrjgoff
23 changes: 12 additions & 11 deletions coverage-frontend-tests-results.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion developer.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ktcbfaiqarssuvg1x7rkj1elfb9jiywl
023o1y0p69tysfrfyuz06gvnecp3cx8e
648 changes: 638 additions & 10 deletions devhub-parallel-test-results.html

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions pages/desktop/developers/devhub_home.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ class DevHubHome(Base):
By.CSS_SELECTOR,
".DevHub-content-container--get-involved p",
)
_add_ons_contribute_title_locator = (
By.CSS_SELECTOR,
".mw-first-heading"
)
_dev_community_link_locator = (
By.CSS_SELECTOR,
".DevHub-content-container--get-involved a",
Expand Down Expand Up @@ -233,6 +237,11 @@ def devhub_get_involved_image(self):
self.wait_for_element_to_be_displayed(self._get_involved_image_locator)
return self.find_element(*self._get_involved_image_locator)

@property
def devhub_addon_contribute_title(self):
self.wait_for_element_to_be_displayed(self._add_ons_contribute_title_locator)
return self.find_element(*self._add_ons_contribute_title_locator)

def click_content_login_link(self):
self.wait_for_element_to_be_clickable(self._page_content_login_link_locator)
self.find_element(*self._page_content_login_link_locator).click()
Expand Down
2 changes: 1 addition & 1 deletion pages/desktop/reviewer_tools/reviewer_tools_homepage.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def click_moderation_guide_click(self):
new_tab = self.driver.window_handles[1]
self.driver.switch_to.window(new_tab)
self.wait.until(
EC.visibility_of_element_located((By.XPATH, "//h1[contains(text(),'Add-ons/Reviewers/Guide/Moderation')]"))
EC.visibility_of_element_located((By.XPATH, "//span[contains(text(),'Add-ons/Reviewers/Guide/Moderation')]"))
)
self.driver.close()
self.driver.switch_to.window(current_tab)
Expand Down
22 changes: 11 additions & 11 deletions reviewer-tools-stage-test-results.html
Original file line number Diff line number Diff line change
Expand Up @@ -429,9 +429,9 @@
}
</script>
<h1>reviewer-tools-stage-test-results.html</h1>
<p>Report generated on 09-Sep-2024 at 10:25:09 by <a href="https://pypi.python.org/pypi/pytest-html">pytest-html</a> v3.1.1</p>
<p>Report generated on 05-Dec-2024 at 16:01:32 by <a href="https://pypi.python.org/pypi/pytest-html">pytest-html</a> v3.1.1</p>
<h2>Summary</h2>
<p>9 tests ran in 448.98 seconds. </p>
<p>9 tests ran in 441.83 seconds. </p>
<p class="filter" hidden="true">(Un)check the boxes to filter the results.</p><input checked="true" class="filter" data-test-result="passed" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="passed">9 passed</span>, <input checked="true" class="filter" data-test-result="skipped" disabled="true" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="skipped">0 skipped</span>, <input checked="true" class="filter" data-test-result="failed" disabled="true" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="failed">0 failed</span>, <input checked="true" class="filter" data-test-result="error" disabled="true" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="error">0 errors</span>, <input checked="true" class="filter" data-test-result="xfailed" disabled="true" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="xfailed">0 expected failures</span>, <input checked="true" class="filter" data-test-result="xpassed" disabled="true" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="xpassed">0 unexpected passes</span>, <input checked="true" class="filter" data-test-result="rerun" disabled="true" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="rerun">0 rerun</span>
<h2>Results</h2>
<table id="results-table">
Expand All @@ -447,7 +447,7 @@ <h2>Results</h2>
<tr>
<td class="col-result">Passed</td>
<td class="col-name">tests/reviewer_tools/test_reviewer_tools_release.py::test_reviewer_tools_homepage_layout_tc_id_c4589[Desktop]</td>
<td class="col-duration">48.94</td>
<td class="col-duration">49.31</td>
<td class="col-links"></td></tr>
<tr>
<td class="extra" colspan="4">
Expand All @@ -457,7 +457,7 @@ <h2>Results</h2>
<tr>
<td class="col-result">Passed</td>
<td class="col-name">tests/reviewer_tools/test_reviewer_tools_release.py::test_queues_manual_review_queue_tc_id_c4583[Desktop]</td>
<td class="col-duration">48.65</td>
<td class="col-duration">48.05</td>
<td class="col-links"></td></tr>
<tr>
<td class="extra" colspan="4">
Expand All @@ -467,7 +467,7 @@ <h2>Results</h2>
<tr>
<td class="col-result">Passed</td>
<td class="col-name">tests/reviewer_tools/test_reviewer_tools_release.py::test_queues_content_review_tc_id_c79313[Desktop]</td>
<td class="col-duration">48.23</td>
<td class="col-duration">47.63</td>
<td class="col-links"></td></tr>
<tr>
<td class="extra" colspan="4">
Expand All @@ -477,7 +477,7 @@ <h2>Results</h2>
<tr>
<td class="col-result">Passed</td>
<td class="col-name">tests/reviewer_tools/test_reviewer_tools_release.py::test_queues_themes_awaiting_review_tc_id_c325790[Desktop]</td>
<td class="col-duration">51.26</td>
<td class="col-duration">47.83</td>
<td class="col-links"></td></tr>
<tr>
<td class="extra" colspan="4">
Expand All @@ -487,7 +487,7 @@ <h2>Results</h2>
<tr>
<td class="col-result">Passed</td>
<td class="col-name">tests/reviewer_tools/test_reviewer_tools_release.py::test_information_on_add_on_review_page_tc_id_C354060[Desktop]</td>
<td class="col-duration">48.13</td>
<td class="col-duration">49.02</td>
<td class="col-links"></td></tr>
<tr>
<td class="extra" colspan="4">
Expand All @@ -497,7 +497,7 @@ <h2>Results</h2>
<tr>
<td class="col-result">Passed</td>
<td class="col-name">tests/reviewer_tools/test_reviewer_tools_release.py::test_logs_add_on_review_log_tc_id_C4588[Desktop]</td>
<td class="col-duration">48.19</td>
<td class="col-duration">47.89</td>
<td class="col-links"></td></tr>
<tr>
<td class="extra" colspan="4">
Expand All @@ -507,7 +507,7 @@ <h2>Results</h2>
<tr>
<td class="col-result">Passed</td>
<td class="col-name">tests/reviewer_tools/test_reviewer_tools_release.py::test_logs_moderated_review_log_tc_id_C4614[Desktop]</td>
<td class="col-duration">49.21</td>
<td class="col-duration">51.24</td>
<td class="col-links"></td></tr>
<tr>
<td class="extra" colspan="4">
Expand All @@ -517,7 +517,7 @@ <h2>Results</h2>
<tr>
<td class="col-result">Passed</td>
<td class="col-name">tests/reviewer_tools/test_reviewer_tools_release.py::test_reviewer_tools_review_guide_for_each_queue_page_C104890[Desktop]</td>
<td class="col-duration">57.14</td>
<td class="col-duration">51.63</td>
<td class="col-links"></td></tr>
<tr>
<td class="extra" colspan="4">
Expand All @@ -527,7 +527,7 @@ <h2>Results</h2>
<tr>
<td class="col-result">Passed</td>
<td class="col-name">tests/reviewer_tools/test_reviewer_tools_release.py::test_queues_ratings_awaiting_moderation_tc_id_C4586[Desktop]</td>
<td class="col-duration">48.97</td>
<td class="col-duration">49.12</td>
<td class="col-links"></td></tr>
<tr>
<td class="extra" colspan="4">
Expand Down
2 changes: 1 addition & 1 deletion reviewer_user.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2b2h3k0ab4tmew19yhnew3qo6tho9irx
6j3htf5bmjb95zww3xdxe1yoguzytq7s
Binary file modified sample-addons/make-addon.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion sample-addons/manifest.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"manifest_version": 2, "theme": {"frame": "#083af0", "tab_background_text": "#ffffff"}, "version": "122.0", "name": "New version auto-approval"}
{"manifest_version": 2, "version": "3.0", "name": "EN-US Name edited"}
50 changes: 43 additions & 7 deletions sanity-parallel-test-results.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions stage.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
"page_not_accessible_in_your_region": "The page you tried to access is not available in your region.",
"paragraph_with_links": "You may be able to find what you’re looking for in one of the available extensions or themes, or by asking for help on our community forums.",

"card_header_text": "Test Tab Mix has been blocked for your protection.",
"why_was_it_blocked": "Why was it blocked?",
"card_header_text": "Test Tab Mix is blocked for violating Mozilla policies",
"why_was_it_blocked": "Why did this happen?",
"block_metadata": "Versions blocked: all versions."
}
16 changes: 16 additions & 0 deletions tests/api/test_api_versions_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ def test_edit_version_set_custom_license(base_url, session_auth):

@pytest.mark.serial
@pytest.mark.create_session("api_user")
@pytest.mark.fail
def test_upload_new_listed_version(base_url, session_auth):
"""Uploads a new listed version for an existing addon"""
with open("sample-addons/listed-addon-new-version.zip", "rb") as file:
Expand Down Expand Up @@ -146,6 +147,7 @@ def test_upload_new_listed_version(base_url, session_auth):

@pytest.mark.serial
@pytest.mark.create_session("api_user")
@pytest.mark.fail
def test_upload_new_version_with_existing_version_number(base_url, session_auth):
"""Uploads a new version with an existing version number; the upload should fail"""
with open("sample-addons/listed-addon-new-version.zip", "rb") as file:
Expand All @@ -156,11 +158,15 @@ def test_upload_new_version_with_existing_version_number(base_url, session_auth)
data={"channel": "listed"},
)
time.sleep(5)
print("Post upload json: " + f"{upload}")
upload.raise_for_status()
# get the addon uuid generated after upload
uuid = upload.json()["uuid"]
print("UUID json: " + f"{uuid}")
addon = payloads.edit_addon_details["slug"]
print("addon json: " + f"{addon}")
payload = payloads.new_version_details(uuid)
print("payload json: " + f"{payload}")
new_version = requests.post(
url=f"{base_url}{_addon_create}{addon}/versions/",
headers={
Expand All @@ -169,6 +175,7 @@ def test_upload_new_version_with_existing_version_number(base_url, session_auth)
},
data=json.dumps(payload),
)
print("payload json: " + f"{new_version}")
assert (
new_version.status_code == 409
), f"Actual response: status code = {new_version.status_code}, message = {new_version.text}"
Expand Down Expand Up @@ -349,12 +356,14 @@ def test_edit_version_change_sources(base_url, session_auth):
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
print("Request addon create: " + f"{request.json()}")
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
get_old_source = requests.get(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={"Authorization": f"Session {session_auth}"},
)
print("get old source request: " + f"{get_old_source.json()}")
# download the previous source code attached to the version
previous_source = requests.get(
get_old_source.json()["source"], cookies={"sessionid": session_auth}, timeout=10
Expand All @@ -365,14 +374,21 @@ def test_edit_version_change_sources(base_url, session_auth):
headers={"Authorization": f"Session {session_auth}"},
files={"source": source},
)

print("previous source: " + f"{previous_source.json()}")
print("change source: " + f"{change_source.json()}")

# download the new source code attached to the version
new_source = requests.get(
change_source.json()["source"], cookies={"sessionid": session_auth}, timeout=10
)
print("new source: " + f"{new_source.json()}")

# compare that the previous source and the new source do not match
api_helpers.compare_source_files(previous_source, new_source, "PATCH")



@pytest.mark.parametrize(
"file_type",
[
Expand Down
8 changes: 4 additions & 4 deletions tests/coverage/test_coverage_frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def test_blocked_frontend_page_tc_id_c1771696(selenium, base_url, wait, variable
variables["why_was_it_blocked"]
in detail_page.why_was_it_blocked.text
)
assert (
variables["block_metadata"]
in detail_page.block_metadata.text
)
# assert (
# variables["block_metadata"]
# in detail_page.block_metadata.text
# )

23 changes: 11 additions & 12 deletions tests/devhub/test_devhub_home.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ def test_devhub_page_overview(selenium, base_url, variables):
# checks that the link redirects to the extension workshop
page.extension_workshop_is_loaded()

@pytest.mark.sanity
@pytest.mark.nondestructive
def test_devhub_page_get_involved(selenium, base_url, variables):
page = DevHubHome(selenium, base_url).open().wait_for_page_to_load()
# checks the content in the page 'Get Involved' - secondary section
assert variables["devhub_get_involved_header"] in page.devhub_get_involved_title
assert variables["devhub_get_involved_summary"] in page.devhub_get_involved_summary
assert page.devhub_get_involved_image.is_displayed()
page.devhub_get_involved_link.click()
page.wait_for_element_to_be_displayed(page.devhub_addon_contribute_title)
assert page.devhub_addon_contribute_title.text in "Add-ons/Contribute"

@pytest.mark.sanity
@pytest.mark.nondestructive
Expand All @@ -88,18 +99,6 @@ def test_devhub_content_login_link(selenium, base_url, variables):
page.wait_for_current_url(variables["fxa_login_page"])


@pytest.mark.sanity
@pytest.mark.nondestructive
def test_devhub_page_get_involved(selenium, base_url, variables):
page = DevHubHome(selenium, base_url).open().wait_for_page_to_load()
# checks the content in the page 'Get Involved' - secondary section
assert variables["devhub_get_involved_header"] in page.devhub_get_involved_title
assert variables["devhub_get_involved_summary"] in page.devhub_get_involved_summary
assert page.devhub_get_involved_image.is_displayed()
page.devhub_get_involved_link.click()
page.wait_for_title_update("Add-ons/Contribute")


@pytest.mark.nondestructive
@pytest.mark.login("developer")
def test_devhub_click_my_addons_header_link(selenium, base_url, wait):
Expand Down
19 changes: 10 additions & 9 deletions tests/frontend/test_addon_detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,33 +434,33 @@ def test_more_info_external_license(selenium, base_url, variables):
),
(
"gnu-general-2-0",
"GNU General Public License v2.0",
"https://www.gnu.org/licenses/old-licenses/gpl-2.0",
"GNU General Public License v2.0 only",
"https://spdx.org/licenses/GPL-2.0-only.html",
),
(
"gnu-general-3-0",
"GNU General Public License v3.0",
"https://www.gnu.org/licenses/gpl-3.0",
"https://spdx.org/licenses/GPL-3.0-only.html",
),
(
"gnu-library-2-1",
"GNU Lesser General Public License v2.1",
"https://www.gnu.org/licenses/old-licenses/lgpl-2.1",
"https://spdx.org/licenses/LGPL-2.1-only.html",
),
(
"gnu-library-3-0",
"GNU Lesser General Public License v3.0",
"https://www.gnu.org/licenses/lgpl-3.0",
"https://spdx.org/licenses/LGPL-3.0-only.html",
),
(
"mit-license",
"The MIT License",
"https://opensource.org/license/mit",
"MIT License",
"https://spdx.org/licenses/MIT.html",
),
(
"bsd-license",
"The 2-Clause BSD License",
"https://opensource.org/license/bsd-2-clause",
"BSD 2-Clause \"Simplified\" License",
"https://spdx.org/licenses/BSD-2-Clause.html",
),
],
ids=[
Expand All @@ -473,6 +473,7 @@ def test_more_info_external_license(selenium, base_url, variables):
"The 2-Clause BSD License",
],
)
@pytest.mark.fail
def test_more_info_builtin_licenses(
selenium, base_url, extension, license_name, license_link
):
Expand Down
1 change: 1 addition & 0 deletions tests/frontend/test_home.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ def test_theme_categories_shelf_tc_id_c95105(base_url, selenium, count, category
# Tests covering the homepage footer
@pytest.mark.sanity
@pytest.mark.nondestructive
@pytest.mark.prod_only
def test_mozilla_footer_link_tc_id_c95105(base_url, selenium):
page = Home(selenium, base_url).open().wait_for_page_to_load()
page.footer.mozilla_link.click()
Expand Down
2 changes: 1 addition & 1 deletion tests/frontend/test_sanity.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def test_language_tools_landing_page(selenium, base_url, variables):
assert variables["language_packs_info"] in page.language_packs_info_text
# we don't always know the number of supported languages in advance,
# but we can make sure we are in close range to what we always supported
assert len(page.supported_languages_list) in range(120, 140)
assert len(page.supported_languages_list) in range(130, 150)


@pytest.mark.nondestructive
Expand Down
5 changes: 3 additions & 2 deletions tests/frontend/test_static_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,18 @@ def test_about_firefox_addons_page_loaded_correctly(base_url, selenium, variable


@pytest.mark.nondestructive
@pytest.mark.fail
def test_blocked_addon_page_loaded_correctly(base_url, selenium, variables):
selenium.get(variables["static_page_blocked_addon"])
page = StaticPages(selenium, base_url)
# verify the tab title
assert (
f'{variables["blocked_addon_name"]} is blocked for violating Mozilla policies. – Add-ons for Firefox (en-US)'
f'{variables["blocked_addon_name"]} is blocked for violating Mozilla policies – Add-ons for Firefox (en-US)'
in page.driver.title
)
# verify the header
assert (
f'{variables["blocked_addon_name"]} is blocked for violating Mozilla policies.'
f'{variables["blocked_addon_name"]} is blocked for violating Mozilla policies'
in page.page_header
)
# verify the paragraphs
Expand Down

0 comments on commit fa2a39b

Please sign in to comment.