Andreas Gohr
Andreas Gohr

Reputation: 4935

Multiple Environments in Travis CI

Travis has an easy way to test a project against different PHP versions.

Now I want to run tests for plugins. For that I wrote a script that is called in the install phase of .travis.yml which checks out the main project and moves my plugin source into the correct directory. Then the tests are run. So far so good.

Now I would like to provide two of these scripts. One that checks out the main project's current master branch and one that checks out the latest stable version. The plugin should be tested against both checkouts in completely separate test runs just like it is ran against different PHP versions.

Is there a simple way to configure this in .travis.yml?

Upvotes: 3

Views: 1348

Answers (1)

user2288008
user2288008

Reputation:

You need to use env option:

env:
    - TEST_NAME=my_test_1
    - TEST_NAME=my_test_2
    - TEST_NAME=my_test_3

script:
    - ./test-run.sh --test-name=${TEST_NAME}

Upvotes: 6

Related Questions