How to test a project that need keyboard input with travis-ci.org?

Adolfo Correa

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:

Python 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?

Adolfo Correa

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.

edited at
0

Comments

0 comments
Login to comment

Related

Using travis-ci.org with a pure as3 project

How to test Jupyter notebooks on Travis CI?

Need to View Travis CI Test Stats on Repo Pull Requests via the Travis API Calls

How does travis-ci.org throttle builds?

Simulating global keyboard shortcuts to test an Electron app in travis-ci and appveyor

How to setup Travis CI for a Django project hosted on Heroku?

How can I compile a project two different ways in Travis CI?

How to run Golang and Karma tests within one project on Travis CI

How to test Pl/Python PostgreSQL procedures with Travis CI?

How to make Travis CI test package for Linux, OS X, Windows?

How do I integrate travis ci with codeclimate test coverage in Python?

How to get Travis CI to build and test xcode projects hosted on Github?

How to get the current split index of test in Travis-CI?

How to use different R versions to test packages with Travis-CI?

How can I make Travis CI use input() in python?

How to input a password in Travis CI while deploy to DigitalOcean via ssh

Travis CI - android gradle project

Golang project Travis CI Build fails with error `Makefile:15: recipe for target 'test' failed`

Test a forked Github project by Travis?

Travis CI skip tests (Gradle Android project)

Travis CI, Atoum and Coveralls for a PHP project

Travis CI - Android Project Build Failing

Setting up postgresql in Travis CI for django project

Travis CI for a Qt5 project

Setting jshint and travis-ci for javascript project

Travis-CI stopped building Github project

Mocha test passes locally, but fails on Travis CI

Travis-CI GoLang Examples test error

Usage of environment variable of Travis CI in maven test