def _select_environments(cli_envs, suite_envs, project_envs):
    """Define the environments to use for the test.

    The test can have a list of environments set from 2 places:
      - using the -e|--environments CLI argument
      - suite `environments` variable

    If both of these are empty try using the first env if there
    are any envs defined. Otherwise just return ['']
    meaning, no envs will be used.
    """
    envs = []
    if cli_envs:
        # use the environments passed through command line if available
        envs = cli_envs
    elif suite_envs:
        # use the environments defined in the suite
        envs = suite_envs
    elif project_envs:
        # if there are available envs, try to use the first by default
        envs = [project_envs[0]]
    else:
        # execute using a blank environment
        envs = ['']
    return envs