Permalink
Browse files

Merge pull request #475 from davehunt/deactivate

Deactivate project and add note to README
  • Loading branch information...
2 parents 438ea4e + 1f75740 commit d9d35ac6ecaa533517e64f47dc83e6b2e5dc5f0a @rbillings rbillings committed Feb 26, 2016
Showing with 5 additions and 279 deletions.
  1. +0 −2 .gitignore
  2. +0 −7 .travis.yml
  3. +0 −16 Dockerfile
  4. +5 −10 README.md
  5. +0 −4 requirements.txt
  6. +0 −7 run.sh
  7. +0 −7 setup.cfg
  8. +0 −20 tests/test_404.py
  9. +0 −82 tests/test_redirect.py
  10. +0 −74 tests/test_redirect_landing.py
  11. +0 −50 tests/test_urls.py
View
@@ -1,2 +0,0 @@
-*.pyc
-.cache
View
@@ -1,7 +0,0 @@
-language: python
-python: 2.7
-install: "pip install flake8"
-script: "flake8 ."
-notifications:
- email:
- - webqa-ci@mozilla.org
View
@@ -1,16 +0,0 @@
-FROM debian:jessie
-
-WORKDIR /app
-CMD ["./run.sh"]
-
-RUN apt-get update && \
- apt-get install -y --no-install-recommends python2.7 libpython2.7 build-essential python-dev python-pip && \
- rm -rf /var/lib/apt/lists/*
-
-ENV BASE_URL "https://www-dev.allizom.org"
-ENV PYTHONDONTWRITEBYTECODE=1
-
-COPY requirements.txt /app/requirements.txt
-RUN pip install -r requirements.txt pytest-xdist
-
-COPY . /app
View
@@ -1,11 +1,6 @@
-# Tests for Mozilla's website
-This repository contains tests for [Mozilla's website](https://www.mozilla.org/).
-
-[![license](https://img.shields.io/badge/license-MPL%202.0-blue.svg)](https://github.com/mozilla/mcom-tests/blob/master/LICENSE)
-[![travis](https://img.shields.io/travis/mozilla/mcom-tests.svg?label=travis)](http://travis-ci.org/mozilla/mcom-tests/)
-[![requirements](https://img.shields.io/requires/github/mozilla/mcom-tests.svg)](https://requires.io/github/mozilla/mcom-tests/requirements/?branch=master)
-
-## Relocation
-These tests are in the process of being relocated. For further information,
-please see the project's [repository](https://github.com/mozilla/bedrock) and
+This repository is no longer being actively maintained, and the content has
+been relocated to the project's
+[repository](https://github.com/mozilla/bedrock).
+Please use the repository history to access the previous content.
+For further information, please see the project's
[documentation](http://bedrock.readthedocs.org/en/latest/testing.html).
View
@@ -1,4 +0,0 @@
-beautifulsoup4==4.4.1
-pytest==2.7.3
-pytest-selenium
-requests==2.8.0
View
7 run.sh
@@ -1,7 +0,0 @@
-#!/bin/bash
-
-py.test -r=fsxXR --verbose -n 15 \
- --base-url ${BASE_URL} \
- --html results/index.html \
- --junitxml results/results.xml \
- tests
View
@@ -1,7 +0,0 @@
-[flake8]
-ignore=E501
-
-[pytest]
-addopts=-r=fEsxXw
-base_url=https://www-dev.allizom.org
-sensitive_url=mozilla\.(com|org)
View
@@ -1,20 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-import pytest
-import requests
-
-
-class TestStatus(object):
-
- @pytest.mark.nondestructive
- def test_status_code_returns_404(self, base_url):
- r = requests.get('{0}/abck'.format(base_url))
- assert requests.codes.not_found == r.status_code
-
- @pytest.mark.nondestructive
- def test_xrobots_tag_is_present(self, base_url):
- """Test for X-Robots-Tag header"""
- r = requests.get(base_url)
- assert 'noodp' == r.headers.get('x-robots-tag')
View
@@ -1,82 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-import re
-
-import pytest
-import requests
-
-
-@pytest.mark.nondestructive
-@pytest.mark.parametrize('origin, destination, locale', [
- ('{base_url}/', '{base_url}/{locale}/', 'en-US'),
- ('{base_url}/firefox/', '{base_url}/{locale}/firefox/new/', 'en-US'),
- ('{base_url}/firefox/mobile/', '{base_url}/{locale}/firefox/android/', 'en-US'),
- ('{base_url}/aurora/', '{base_url}/{locale}/firefox/channel/', 'en-US'),
- ('{base_url}/beta/', '{base_url}/{locale}/firefox/channel/', 'en-US'),
- ('{base_url}/community/', '{base_url}/{locale}/contribute/', 'en-US'),
- ('{base_url}/mobile/37.0/releasenotes/', '{base_url}/{locale}/firefox/android/37.0/releasenotes/', 'en-US'),
- ('{base_url}/mobile/37.0beta/releasenotes/', '{base_url}/{locale}/firefox/android/37.0beta/releasenotes/', 'en-US'),
- ('{base_url}/mobile/37.0a2/auroranotes/', '{base_url}/{locale}/firefox/android/37.0a2/auroranotes/', 'en-US'),
- ('{base_url}/mobile/faq/', '{base_url}/{locale}/firefox/android/faq/', 'en-US'),
- ('{base_url}/mobile/features/', '{base_url}/{locale}/firefox/android/', 'en-US'),
- ('{base_url}/mobile/platforms/', 'https://support.mozilla.org/{locale}/kb/will-firefox-work-my-mobile-device', 'en-US'),
- ('{base_url}/m/faq/', '{base_url}/{locale}/firefox/android/faq/', 'en-US'),
- ('{base_url}/m/features/', '{base_url}/{locale}/firefox/android/', 'en-US'),
- ('{base_url}/m/platforms/', 'https://support.mozilla.org/{locale}/kb/will-firefox-work-my-mobile-device', 'en-US'),
- ('{base_url}/m/', '{base_url}/{locale}/firefox/new/', 'en-US'),
- ('{base_url}/rhino/doc.html', 'https://developer.mozilla.org/{locale}/docs/Mozilla/Projects/Rhino/Documentation', 'en-US'),
- ('{base_url}/rhino/download.html', 'https://developer.mozilla.org/{locale}/docs/Mozilla/Projects/Rhino/Download_Rhino', 'en-US'),
- ('{base_url}/rhino/', 'https://developer.mozilla.org/{locale}/docs/Mozilla/Projects/Rhino', 'en-US'),
- ('{base_url}/mobile/home/', 'https://blog.mozilla.org/services/2012/08/31/retiring-firefox-home/', 'en-US'),
- ('{base_url}/{locale}/mobile/home/', 'https://blog.mozilla.org/services/2012/08/31/retiring-firefox-home/', 'fr'),
- ('{base_url}/firefox/all-older.html', '{base_url}/{locale}/firefox/new/', 'en-US'),
- ('{base_url}/projects/firefox/3.6.13/firstrun/', '{base_url}/{locale}/firefox/new/', 'en-US'),
- ('{base_url}/projects/firefox/3.6.13/whatsnew/', '{base_url}/{locale}/firefox/new/', 'en-US'),
- ('{base_url}/metrofirefox/', '{base_url}/{locale}/firefox/new/', 'en-US'),
- ('{base_url}/newsletter/', '{base_url}/{locale}/newsletter/', 'en-US'),
- ('{base_url}/newsletter/', '{base_url}/{locale}/newsletter/', 'pl'),
- ('{base_url}/apps/', 'https://marketplace.firefox.com/', 'en-US'),
- ('{base_url}/firefox/technology/', 'https://developer.mozilla.org/{locale}/docs/Tools', 'en-US'),
- ('{base_url}/firefox/performance/', '{base_url}/{locale}/firefox/desktop/fast/', 'en-US'),
- ('{base_url}/firefox/security/', '{base_url}/{locale}/firefox/desktop/trust/', 'en-US'),
- ('{base_url}/firefox/new/', '{base_url}/{locale}/firefox/new/', 'en-US'),
- ('{base_url}/firefox/new/', '{base_url}/{locale}/firefox/new/', 'son'),
- ('{base_url}/firefox/new/', '{base_url}/{locale}/firefox/new/', 'zh-CN'),
- ('{base_url}/firefox/new/', '{base_url}/{locale}/firefox/new/', 'ta'),
- ('{base_url}/privacy/archive/', '{base_url}/{locale}/privacy/archive/', 'en-US'),
- ('{base_url}/dnt/', '{base_url}/{locale}/firefox/dnt/', 'en-US'),
- ('{base_url}/firefox/os/notes/', 'https://developer.mozilla.org/{locale}/Firefox_OS/Releases', 'en-US'),
- ('{base_url}/firefox/os/notes/2.0/', 'https://developer.mozilla.org/{locale}/Firefox_OS/Releases/2.0', 'en-US'),
- ('https://www.mozilla.com/', 'https://www.mozilla.org/{locale}/firefox/new/', 'en-US'),
- ('https://aurora.mozilla.org/', 'https://www.mozilla.org/{locale}/firefox/channel/', 'en-US'),
- ('https://beta.mozilla.org/', 'https://www.mozilla.org/{locale}/firefox/channel/#beta', 'en-US')])
-def test_redirect(origin, destination, locale, base_url):
- url = origin.format(base_url=base_url, locale=locale)
- headers = {'Accept-Language': locale}
- r = requests.get(url, allow_redirects=True, headers=headers)
- for h in r.history:
- assert h.status_code in [requests.codes.moved_permanently,
- requests.codes.found]
- assert destination.format(base_url=base_url, locale=locale) == r.url
- assert requests.codes.ok == r.status_code, r.url
-
-
-@pytest.mark.nondestructive
-@pytest.mark.parametrize('origin, destination, locale', [
- ('{base_url}/mobile/notes/', '{base_url}\/{locale}\/firefox\/android\/[\d\.]+\/releasenotes\/', 'en-US'),
- ('{base_url}/mobile/beta/notes/', '{base_url}\/{locale}\/firefox\/android\/[\d\.]+beta\/releasenotes\/', 'en-US'),
- ('{base_url}/mobile/aurora/notes/', '{base_url}\/{locale}\/firefox\/android\/[\d\.a-zA-Z]+\/auroranotes\/', 'en-US'),
- ('{base_url}/firefox/notes/', '{base_url}\/{locale}\/firefox\/[\d\.]+\/releasenotes\/', 'en-US')])
-def test_redirect_regex(origin, destination, locale, base_url):
- url = origin.format(base_url=base_url, locale=locale)
- headers = {'Accept-Language': locale}
- r = requests.get(url, allow_redirects=True, headers=headers)
- for h in r.history:
- assert h.status_code in [requests.codes.moved_permanently,
- requests.codes.found]
- expected = destination.format(base_url=re.escape(base_url),
- locale=re.escape(locale))
- assert re.match(expected, r.url) is not None
- assert requests.codes.ok == r.status_code, r.url
@@ -1,74 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-import pytest
-import requests
-
-# List of the current supported locales on /firefox/new/
-LOCALES = (
- 'ar', 'ast', 'bg', 'bn-IN', 'ca', 'cs', 'de', 'dsb', 'el', 'en-GB',
- 'en-US', 'es-CL', 'es-ES', 'fr', 'fy-NL', 'gd', 'it', 'ja', 'ko', 'nl',
- 'pt-BR', 'pt-PT', 'ru', 'sv-SE', 'tr', 'uk', 'zh-TW')
-
-# List of some locale name variants including unsupported short names and
-# obsolete ab-CD-style names, which could be included in the visitors'
-# Accept-Language HTTP header and should be redirected to the respective
-# canonical locales
-LOCALE_VARIANTS = {
- 'en': 'en-US',
- 'en-CA': 'en-US',
- 'es': 'es-ES',
- 'es-419': 'es-ES',
- 'fr-FR': 'fr',
- 'ja-JP-mac': 'ja',
- 'pt': 'pt-BR',
- 'ta-LK': 'ta'}
-
-USER_AGENTS = {
- 'FIREFOX': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Firefox/24.0',
- 'ESR_FIREFOX': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Firefox/17.0.8',
- 'OLD_FIREFOX': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:16.0) Gecko/16.0 Firefox/16.0',
- 'MOBILE': 'Mozilla/5.0 (Linux; U; Android 4.0.3; HTC Sensation Build/IML74K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30',
- 'NON_FIREFOX': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.4 Safari/537.1',
- 'IOS': 'Mozilla/5.0 (iPhone; CPU iPhone OS 5_0_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9A405'}
-
-
-def pytest_generate_tests(metafunc):
- argvalues = []
- for user_agent in USER_AGENTS.values():
- # check the landing page redirects for each user agent
- argvalues.append((
- '{base_url}/firefox/',
- '{base_url}/{locale}/firefox/new/',
- 'en-US', user_agent))
- for locale in LOCALES:
- # check the landing page redirects for each locale
- for user_agent in [USER_AGENTS['FIREFOX'],
- USER_AGENTS['ESR_FIREFOX'],
- USER_AGENTS['MOBILE']]:
- argvalues.append((
- '{base_url}/firefox/',
- '{base_url}/{locale}/firefox/new/',
- locale, user_agent))
- for variant, locale in LOCALE_VARIANTS.items():
- # check the landing page redirects for each locale variant
- argvalues.append((
- '{base_url}/firefox/',
- '{base_url}/%s/firefox/new/' % locale,
- variant, USER_AGENTS['FIREFOX']))
- metafunc.parametrize('origin, destination, locale, user_agent', argvalues)
-
-
-@pytest.mark.nondestructive
-def test_redirect(origin, destination, locale, user_agent, base_url):
- url = origin.format(base_url=base_url, locale=locale)
- headers = {'Accept-Language': locale}
- if user_agent is not None:
- headers['User-Agent'] = user_agent
- r = requests.get(url, allow_redirects=True, headers=headers)
- for h in r.history:
- assert h.status_code in [requests.codes.moved_permanently,
- requests.codes.found]
- assert destination.format(base_url=base_url, locale=locale) == r.url
- assert requests.codes.ok == r.status_code, r.url
View
@@ -1,50 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-import pytest
-import requests
-
-
-@pytest.mark.nondestructive
-@pytest.mark.parametrize('path', [
- 'firefox/',
- 'firefox/all/',
- 'firefox/android/',
- 'firefox/android/faq/',
- 'firefox/aurora/all/',
- 'firefox/beta/all/',
- 'firefox/brand/',
- 'firefox/channel/',
- 'firefox/channel/android/',
- 'firefox/desktop/',
- 'firefox/developer/',
- 'firefox/geolocation/',
- 'firefox/installer-help/',
- 'firefox/interest-dashboard/',
- 'firefox/latest/releasenotes/',
- 'firefox/mobile/',
- 'firefox/new/',
- 'firefox/nightly/firstrun/',
- 'firefox/organizations/',
- 'firefox/os/',
- 'firefox/os/notes/1.1',
- 'firefox/partners/',
- 'firefox/releases/',
- 'firefox/speed/',
- 'firefox/sync/',
- 'firefox/tiles/',
- 'firefox/unsupported-systems/',
- 'firefox/unsupported/EOL/',
- # Legacy URLs (Bug 1110927)
- 'firefox/panorama/',
- 'firefox/start/central.html',
- 'firefox/sync/firstrun.html',
- # Thunberbird URLs
- 'thunderbird/all/',
- 'thunderbird/releases/'])
-def test_url(path, base_url):
- url = '/'.join([base_url, 'en-US', path])
- r = requests.get(url, timeout=3)
- assert len(r.history) <= 2
- assert requests.codes.ok == r.status_code, url

0 comments on commit d9d35ac

Please sign in to comment.