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

Running Tests

thaissiqueira edited this page Apr 26, 2017 · 11 revisions

In order to follow the test pyramid, this code are implementing some levels of tests:

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 it: 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 is 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 is using React Framework. Each component has its own unit test file.

Libraries:

How to run it: 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 it: 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 it: 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 it:

vagrant up
vagrant ssh
cd /vagrant

To run the mocked funcional tests: make functional_tests

To run the smoke funcional tests: make smoke_tests provider=<your provider domain>

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 funcionalities stability during the application execution.

How to run it: 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:


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