Skip to content
This repository has been archived by the owner on Jan 2, 2020. It is now read-only.

Running Tests

Tulio Casagrande edited this page Jun 5, 2017 · 11 revisions

In order to follow the test pyramid, this project implements multiple levels of tests.

We strongly recommend to run tests inside vagrant machine. You can find informations about how can you do that here.

If you want to run all the tests using just one command (except smoke_tests), you can use:

make test_all

Running tests on your local machine

If you want to run the tests in your host machine outside of vagrant:

$ pip install virtualenv
$ cd <root/of/pixelated-user-agent>
$ make test

If you want to run the tests in your IDE on your host machine outside of vagrant, there's a bug in a LEAP library that can't handle symlinks to your local GPG installation. To fix it, add the path to your GPG binary to your $PATH so that it is found before the symlink in /usr/local/bin (or similar). See also, installations on native OS.

If you want to understand and run each one separately, follow this page:

Unit

Python

Path: https://github.com/pixelated/pixelated-user-agent/tree/master/service/test/unit

What we test with it: Here we are independently testing functions of python code, in an isolated way. Each function has at least one test to assure that it will keep working during the software life cycle, but usually one test is not enough to validate all the branches of a function.

How to run them: make unit_tests_py

Libraries:

Js

Flightjs

Path: https://github.com/pixelated/pixelated-user-agent/tree/master/web-ui/test/spec

What we test with it: Here we are independently testing functions of javascript code that are using FlightJs Framework.

Libraries:

React

Path: The unit tests are inside each component folder in this path https://github.com/pixelated/pixelated-user-agent/tree/master/web-ui/src

What we test with it: Here we are independently testing functions of javascript code that are using React Framework. Each component has its own unit test file.

Libraries:

How to run them: To run both, flightjs and react: make unit_tests_js

Integration

Python

Path: https://github.com/pixelated/pixelated-user-agent/tree/master/service/test/integration

What we test with it: we validate the integration between python components.

How to run them: make integration_tests_py

Libraries:

Js

Path: https://github.com/pixelated/pixelated-user-agent/tree/master/web-ui/test/integration

What we test with it: we validate the integration between js components. We have this kind of test only for the code that is using React.

How to run them: It is ran with the unit tests: make unit_tests_js

Libraries:

Functional

We have two kinds of functional tests to validate Pixelated User Agent. The first one is on pixelated-user-agent repository and the second one is on puppet-pixelated repository.

Functional Tests on pixelated-user-agent repository

Path: https://github.com/pixelated/pixelated-user-agent/tree/master/service/test/functional/features

What we test with it: The pixelated-user-agent functional tests validate all Pixelated User Agent features. Part of these tests exercises the functionalities running the application against mocked components.

The other part runs against an "up and running" application. For this one you should have a instance of pixelated running. This part we run using the @smoke tag.

How to run them:

vagrant up
vagrant ssh
cd /vagrant

To run the mocked funcional tests: make functional_tests

To run the smoke funcional tests (run against a domain that is serving Pixelated): make smoke_tests provider=<your provider domain>

Libraries:

Functional Tests on puppet-pixelated repository

Path: https://github.com/pixelated/puppet-pixelated/tree/master/files/functional-tests

Inside each provider we also have functional testes running hourly by chrontab. These tests are in the puppet-pixelated repository. They validate the functionality's stability during the application execution.

How to run them: Inside the provider run

INVITE_CODE_ENABLED=true /usr/bin/mk-job pixelated-functional-tests /usr/local/bin/behave --stop --tags @staging --tags ~@wip --no-capture -k /srv/leap/tests_custom/functional-tests/

Libraries: