I'm trying to test in travis-ci (continuous integration platform) a simple menu algorithm that wait for user inputs to do tasks (CRUD) like:
show, add, delete, update a registry or exit.
The following is a example code:
This is my .travis.yml file:
language: python
python:
- "2.6"
- "2.7"
- "3.2"
- "3.3"
- "3.4"
- "3.5"
- "3.5-dev" # 3.5 development branch
- "nightly" # currently points to 3.6-dev
# command to install dependencies
# install: "pip install -r requirements.txt"
# command to run tests
script:
- python 1aula_agenda.py
And this was the output from travis-ci.org:
0.00s$ source ~/virtualenv/python2.7/bin/activate
$ python --version
Python 2.7.9
$ pip --version
pip 6.0.7 from /home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages (python 2.7)
Could not locate requirements.txt. Override the install: key in your .travis.yml to install dependencies.
$ python 1aula_agenda.py
0. Visualizar
1. Inserir um contato
2. Remover um contato
3. Alterar um contato
4. Sair do programa
Escolha uma opcao:
No output has been received in the last 10 minutes, this potentially indicates a stalled build or something wrong with the build itself.
The build has been terminated
How can I do that the travis test all the options 0, 1, 2, 3, 4 and add a name and a number in the case of the options 1 and 3?
It's possible create a file testing.txt
with a battery test for test the functions of the program.
testing.txt
contains the keyboard inputs required for the program. For example for test your example
0
1
"John Smith"
"1235-5387"
0
4
and include the testing.txt in the .travis.yml file:
language: python
python:
- "2.6"
- "2.7"
- "3.2"
- "3.3"
- "3.4"
- "3.5"
- "3.5-dev" # 3.5 development branch
- "nightly" # currently points to 3.6-dev
# command to install dependencies
# install: "pip install -r requirements.txt"
# command to run tests
script:
- python 1aula_agenda.py < testing.txt
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments