Skip to content

Latest commit

 

History

History
54 lines (31 loc) · 2.21 KB

TESTING.md

File metadata and controls

54 lines (31 loc) · 2.21 KB

Testing

Why is testing important? Many of us like to sleep at night. So to give us peace of mind when we release a new version of our software, we want to guarantee that the application works as it should, always. To accomplish this we write two kinds of tests that will ensure that our applications behaves as it should even as we add new features.

Unit tests

These tests ensure that individual units of code (functions/methods) return the expected results with different inputs. Think of a sum function. When called as sum(1) we may expect a return value of 1. When called as sum(1, 2) we may expect a return value of 3. And when called with no arguments, we may expect an error to be thrown.

Integration tests

We want to guarantee that our project DC/OS UI works as it should within DC/OS as a product. To do this we want our integration tests to run against a DC/OS cluster. For example we want to test that when an slave fails in a cluster, the UI visually shows this slave failure. A different example is validating that when a new service is installed on a cluster it will show up in the services page.

Setup Instructions:
  1. Install Cypress CLI
npm install -g cypress
  1. Install Cypress desktop app
cypress install
  1. Open Cypress
cypress open

This should show a new icon on your desktop menu bar.

img

  1. Login with Github. Click on the icon on your desktop menu bar and login.

img

  1. Add project to Cypress app

Once you've logged in click on the plus button and add the dcos-ui folder.

img

  1. Once the project is added click on it to start the server

img

img

  1. Ask someone on the team to teach all about writing integration tests.