Skip to content
This repository was archived by the owner on Jun 28, 2024. It is now read-only.
This repository was archived by the owner on Jun 28, 2024. It is now read-only.

Explain $CI behaviour if *not* running under a CI #1649

@jodh-intel

Description

@jodh-intel

We need to update the following section to explain how tests should detect they are not running under a CI by stating what value $CI should be set to (if it should even be set...):

It's clear that if $CI == true we're running under a CI. But what is not clear atm is what $CI should be set to if we are not running under a CI. There seem to be three possibilities:

  • $CI not set
  • $CI set to empty string ("")
  • $CI set to false

We do need to document two things:

  • The expected value of $CI.
  • How to test for "not running under a CI".

For the second bullet, should it be (which assumes $CI will be unset if not running under a CI):

if [ -z "$CI" ]; then
    echo "Not running under CI"
fi

Or should it be the following (which assumes will always be set to CI=false if not running under a CI):

if "$CI"; then
    echo "Not running under CI"
fi

I think the best option is for us to assume that the CI variable is not set if not running under a CI since that provides the least surprising and safest behaviour.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions