GithubHelp home page GithubHelp logo

mozilla-services / services-test Goto Github PK

View Code? Open in Web Editor NEW
9.0 9.0 16.0 4 MB

Tools and test scripts used by the Mozilla Cloud Services team

License: Mozilla Public License 2.0

JavaScript 37.12% Shell 34.41% Python 25.13% Makefile 0.94% Batchfile 1.09% Dockerfile 1.31%

services-test's Introduction

services-test

Description

This repo is intended for: testing tools, test manifests and scripts used by the Mozilla Cloud Services team as part of the Mozilla Cloud Services automated test pipeline.

See: services-qa-jenkins for how these tests are used in Jenkins jobs. This is a private repo that requires permission to view.

Get Involved

You can read about our team and how to get involved at Read the Docs.

Here is a list of contributors to the repo.

Repo Structure

To contribute a new automated test to the services-test repo, please adhere to the following guidelines. This following file structure is required by Jenkins to execute automated tests.

  • {project}/ (directory)
  • One directory per project. For example:
    • services-test/absearch
    • services-test/autopush, etc.
  • {project}/README.md (file)
  • Add README file in project folder with links to: project repo (github), readthedocs, testplan, etc.
  • {project}/{test-type}/ (directory)
  • One project child directory per test-type. For example:
  • services-test/absearch/e2e-test
  • services-test/absearch/schema-check, etc.
  • {project}/{test-type}/run (file)
  • Add a "run" file in each test-type directory which should install all dependencies and kick off a test of the type indicated by the parent directory
  • example: example run file
  • {project}/{test-type}/manifest.ini (file)
  • Add a manifest file in each test-type directory which should specify any environment-specific parameters
  • example: example manifest.ini
  • {project}/{test-type}/misc (files)
  • Any additional files needed by that test type should be self-contained in that directory.

Test Environments

Environments where tests should be run for a given project

TEST ENV DESCRIPTION
stage where most testing happens before prod deployment
stage-loadtest this is a special env for msisnd where we need a different setup for loadtesting. In general loadtesting can take place in stage.
pre-prod final verification in an actual prod env (before DNS switch)
prod final verification to make sure prod deploy was successful. Also, continuous prod testing can be executed as a kind of prod "health check"

Test Types

Specify what kinds of tests should be run for any given environment

TEST TYPE DESCRIPTION
stack-check verify stack procs, urls, etc. are running
config-check verify application configuration
e2e-test client-side test
loadtest verify application scalability
schema-check API test
security ZAP test (TBD)
cdn-test check existence/delivery of remote files

services-test's People

Contributors

chartjes avatar cloud-services-qa avatar cuff-links avatar groovecoder avatar jrbenny35 avatar karlht avatar lavish205 avatar mozilla-github-standards avatar pdehaan avatar rbillings avatar rpappalax avatar stephendonner avatar stuartphilp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

services-test's Issues

[pep8] Fix imports in msisdn-gateway e2e fabfile

/msisdn-gateway/e2e-test/fabfile.py:1-2 has the following:

from fabric.api import *
import fabric

Flake8 doesn't like dis, and complains:

  • ./msisdn-gateway/e2e-test/fabfile.py:1:1: F403 'from fabric.api import *' used; unable to detect undefined names
  • ./msisdn-gateway/e2e-test/fabfile.py:2:1: F401 'fabric' imported but unused

We should try and improve the glob import to avoid flake8 errors and avoid having to do weird hacks like adding # noqa to get flake8 to ignore our code.

[_utils/firefox_download] add args

right now firefox_downloads.py will download all new version of FF for the Jenkins slave env.
This tool would be more useful for general testing if we could specify specific version via args.

Add shavar e2e-test prefs files

We can now use ff-tool to e2e-test shavar, but will need to first convert and add shavar prefs files.

TODO:
figure out how to handle multiple pref sets

Simplify Firefox downloaden

Looking at ./_shared/install_ff_nightly.sh, it may be slightly simpler if we use the lovely firefox-get npm module (assumes the host images all have Node.js installed).

$ curl $(firefox-get -v beta) | tar xz --directory ff_beta

NOTE: This assumes you already have an ./ff_beta/ directory.

We could also possibly abstract this one step further by creating some UNIX-y function where we pass a target "version" of Firefox that we want to download and it will ensure the directory is created for us.

Then we can do one/all of the following:

  • $ download_firefox release
  • $ download_firefox beta
  • $ download_firefox nightly

From there we can create some ENV variables to point to the different Firefox versions, where $FF_BETA points to ./ff_beta/firefox/firefox-bin.

Remove inert run files from all projects

Various projects have inert run(.sh) files that were added as a "first attempt" at scoping out how services-test would operate. Now that we have a working architecture, these should all be removed.

Add opengraph test

This is the Opengraph test I have finished and have been requested to merge here.

Merge /_temp with /_utils/_temp?

Currently we have a couple "floating" _temp folders

  1. the root /_temp/ folder is used for temporary Firefox Profiles (which we can clean up in the nightly refresh job).
  2. We have a /_utils/_temp/ folder is used for temporary Firefox binaries (added by #55 in /_utils/firefox_download.py:41)

We should maybe consider using /_temp/profiles/ and /_temp/firefoxes/, or something.
This will keep everything close, and not have a bunch of random temporary folders peppered throughout the repo.

[firefox-tool] create a separate package

For ease-of-use, we should probably consider moving the download, install, uninstall and profile manager mods bundled into their own package w/ 1 or 2 console entry points. It would be easiest if we start with 1 menu of args and see if that looks practical. I looked through quite a few other github repos around firefox and found some other partial attempts at this, but I think if we put our tools together, it might be fairly useful or others outside of our team as well.

INSTALLERS
https://github.com/chef-cookbooks/firefox
https://github.com/bellpeterm/firefox
https://github.com/zanardo-ansible/firefox
https://github.com/boxen/puppet-firefox

HACKS
https://github.com/omgmog/install-all-firefox/blob/master/install-all-firefox.sh

PROFILE MANAGERS
https://github.com/Puppet-Finland/firefox

Add test-catalog.ini

We need to add a test-catalog.ini to services-test.

The test-catalog.ini in dev would "activate" the jenkins-job-manager to create a corresponding job for every test listed in the catalog in the jenkins-dev.
Likewise, a test-catalog.ini file in the master branch, would activate corresponding jobs for every test listed in the master jenkins.
Forcing contributors to explicitly add their tests to this list would permit contributors to retain tests within services-test that still can be housed in github, but would not have a corresponding Jenkins job.

Example:
https://github.com/rpappalax/jenkins-job-manager/blob/dev/test_catalog.ini

Run pep8 and ESLint on commit?

Me thinks we can use Travis-CI to do this, although not sure of the optimal way. I can try experimenting with this.

Was also looking at Tox since I've seen that used in other projects, but not sure if that is overkill.

As for checking JavaScript files, we could use ESLint, but that may get tricky if we plan on excluding oodles of files/folders (in which case we may need Gulp or Grunt, and we're starting to add a few dependencies to our Travis env).

Probably best to just dive in and start doing a bunch of PRs and see what falls out.

fix: Modify all test run.sh / run.py files to drop file extension

please include:

#!/usr/bin/env python
#!/usr/bin/env node
#!/usr/bin/env cobol

so then we can also leave off the file extension.
Since all our jenkins jobs are generated dynamically (and we can't assume one language), let's just drop the extension altogether.

For treeherder integration, we will probably need to go with either python or node:
see: https://bugzilla.mozilla.org/show_bug.cgi?id=1213542#c8

README should also be updated accordingly

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.