Closed gmr closed 6 years ago
Hi @gmr,
Thanks for reporting this issue!
When some steps aren't explicitly configured, Travis will automatically run default commands depending on the language that you're using. In the case of Python (https://docs.travis-ci.com/user/languages/python/) the default behavior is to run the following install
command:
pip install -r requirements.txt
If you need to skip these default steps, you can use install: skip
or install: true
either in the top level section or inside the jobs that don't need to run anything in the install
section.
Does this help?
I've got a test right now running with:
before_install: true
install: true
before_script: true
script: true
after_success: true
at the top level stanza, will report back shortly. If that works, then I think it would be valuable to update the example documentation to explain the expected behavior of the merging/overwriting of non-declared implied configuration directives. (That is if you're relying on the implied top level behavior, you can not overwrite it in a stage).
Ok, I think what's going on is if i try and define the "test" stage under the jobs > include stanza, it is ignored. I shifted my structure to something similar to the following and it now works as expected across all stages. Seems a bit backwards from what I'd expect.
language: python
env:
global:
- PATH=$HOME/.local/bin:$PATH
stages:
- test
- coverage
- name: deploy
if: tag IS present
services:
- rabbitmq
before_install:
- python --version
- pip --version
install:
- pip install -r test-requirements.txt
before_script:
- pip freeze
- sudo rabbitmqctl status
script: nosetests
after_success:
- aws s3 cp .coverage "s3://com-gavinroy-travis/pika/$TRAVIS_BUILD_NUMBER/.coverage.${TRAVIS_PYTHON_VERSION}"
jobs:
include:
- python: 2.7
- python: 3.4
- python: 3.5
- python: 3.6
- stage: coverage
python: 3.6
before_install: true
install:
- pip install awscli coverage codecov
brefore_script: true
script:
- mkdir coverage
- aws s3 cp --recursive s3://com-gavinroy-travis/pika/$TRAVIS_BUILD_NUMBER/ coverage
- cd coverage
- coverage combine
- cd ..
- mv coverage/.coverage .
- coverage report
after_success: codecov
- stage: deploy
python: 3.6
before_install: true
install: true
before_script: true
script: true
after_success: true
deploy:
distributions: sdist bdist_wheel
Thanks for the feedback @gmr
As Stages is now released and GA, I'm going to close this issue.
If you have any feedback on improvements we should consider, please feel free to add a discussion in our new Community forum: https://travis-ci.community/c/product
Happy building
Josh
It appears that if I have a config as such using build stages:
That no action will be taken as part of the
install
,script
, orafter_success
steps unless the top-levelinstall`,
script, and
after_success`` stanzas are defined.My expectation was that by defining them under the job stanzas it would work but my guess is there's per-job munging that occurs between the top level value and the values in the list and if there is no top level entry for that stanza it is ignored.