コード例 #1
0
def test_no_required_set():
    """
    Test that no required environment variables being set results in an
    error.
    """
    with no_environment_variables_set():
        collect_env_info()
コード例 #2
0
def test_no_required_set():
    """
    Test that no required environment variables being set results in an
    error.
    """
    with no_environment_variables_set():
        collect_env_info()
コード例 #3
0
def test_all_required_set_except_minor_version():
    """
    Test that all required environment variables being set except
    MINOR_VERSION generates an error.
    """
    all_except_minor_version = dict_subtract(ALL_REQ_ENV_VARS, 'MINOR_VERSION')

    with only_these_environment_variables_set(all_except_minor_version):
        collect_env_info()
コード例 #4
0
def test_all_required_set_except_build_number():
    """
    Test that all required environment variables being set except
    BUILD_NUMBER generates an error.
    """
    all_except_build_number = dict_subtract(ALL_REQ_ENV_VARS, 'BUILD_NUMBER')

    with only_these_environment_variables_set(all_except_build_number):
        collect_env_info()
コード例 #5
0
def test_all_required_set_except_build_number():
    """
    Test that all required environment variables being set except
    BUILD_NUMBER generates an error.
    """
    all_except_build_number = dict_subtract(ALL_REQ_ENV_VARS, 'BUILD_NUMBER')

    with only_these_environment_variables_set(all_except_build_number):
        collect_env_info()
コード例 #6
0
def test_all_required_set_except_minor_version():
    """
    Test that all required environment variables being set except
    MINOR_VERSION generates an error.
    """
    all_except_minor_version = dict_subtract(ALL_REQ_ENV_VARS, 'MINOR_VERSION')

    with only_these_environment_variables_set(all_except_minor_version):
        collect_env_info()
コード例 #7
0
def test_non_integer_build_number():
    """
    Test that all required environment variables being set except
    BUILD_NUMBER generates an error.
    """
    all_set_with_non_int_build_num = dict(ALL_REQ_ENV_VARS)
    all_set_with_non_int_build_num['BUILD_NUMBER'] = 'foo'

    with only_these_environment_variables_set(all_set_with_non_int_build_num):
        collect_env_info()
コード例 #8
0
def test_all_required_set_except_build_name_and_teamcity_buildconf_name():
    """
    Test that all required environment variables being set except
    BUILD_NAME *and* TEAMCITY_BUILDCONF_NAME generates an error.
    """
    all_except_any_build_name = dict_subtract(
        ALL_REQ_ENV_VARS, ('BUILD_NAME', 'TEAMCITY_BUILDCONF_NAME'))

    with only_these_environment_variables_set(all_except_any_build_name):
        collect_env_info()
コード例 #9
0
def test_all_required_set_except_build_name_and_teamcity_buildconf_name():
    """
    Test that all required environment variables being set except
    BUILD_NAME *and* TEAMCITY_BUILDCONF_NAME generates an error.
    """
    all_except_any_build_name = dict_subtract(
        ALL_REQ_ENV_VARS, ('BUILD_NAME', 'TEAMCITY_BUILDCONF_NAME'))

    with only_these_environment_variables_set(all_except_any_build_name):
        collect_env_info()
コード例 #10
0
def test_non_integer_build_number():
    """
    Test that all required environment variables being set except
    BUILD_NUMBER generates an error.
    """
    all_set_with_non_int_build_num = dict(ALL_REQ_ENV_VARS)
    all_set_with_non_int_build_num['BUILD_NUMBER'] = 'foo'

    with only_these_environment_variables_set(all_set_with_non_int_build_num):
        collect_env_info()
コード例 #11
0
def standard_sdist_run(submodule_order=None, integration_tests_fn=None):
    args = _parse_args(sys.argv[1:])

    env_info = collect_env_info() if args.publish else None
    verify_cert = not args.no_cert_verify

    if submodule_order:
        execute_submodule_run(submodule_order)

        if not args.skip_int_tests and integration_tests_fn:
            integration_tests_fn()

        if args.publish:
            deploy_all_modules(
                module_order=submodule_order,
                env_info=env_info,
                verify_cert=verify_cert)
    else:
        execute_sdist_run()

        if not args.skip_int_tests and integration_tests_fn:
            integration_tests_fn()

        if args.publish:
            deploy_module(env_info=env_info, verify_cert=verify_cert)
コード例 #12
0
def test_all_required_set():
    """
    Test that all required environment variables being set results in no
    error.
    """
    with only_these_environment_variables_set(ALL_REQ_ENV_VARS):
        env_info = collect_env_info()

    validate_env_info_against_ideal(actual=env_info,
                                    expected=expected_using_build_name)
コード例 #13
0
def test_all_required_set():
    """
    Test that all required environment variables being set results in no
    error.
    """
    with only_these_environment_variables_set(ALL_REQ_ENV_VARS):
        env_info = collect_env_info()

    validate_env_info_against_ideal(
        actual=env_info,
        expected=expected_using_build_name)
コード例 #14
0
def test_all_required_set_except_build_name():
    """
    Test that all required environment variables being set except
    BUILD_NAME is happy.
    """
    all_except_build_name = dict_subtract(ALL_REQ_ENV_VARS, 'BUILD_NAME')

    with only_these_environment_variables_set(all_except_build_name):
        env_info = collect_env_info()

    validate_env_info_against_ideal(
        actual=env_info, expected=expected_using_teamcity_buildconf_name)
コード例 #15
0
def test_all_required_set_except_build_name():
    """
    Test that all required environment variables being set except
    BUILD_NAME is happy.
    """
    all_except_build_name = dict_subtract(ALL_REQ_ENV_VARS, 'BUILD_NAME')

    with only_these_environment_variables_set(all_except_build_name):
        env_info = collect_env_info()

    validate_env_info_against_ideal(
        actual=env_info,
        expected=expected_using_teamcity_buildconf_name)
コード例 #16
0
def test_custom_build_agent_name():
    """
    Test that setting a custom BUILD_AGENT_NAME works.
    """
    custom_build_agent_name = 'Agent Smith'

    env = dict(ALL_REQ_ENV_VARS.items() +
               [('BUILD_AGENT_NAME', custom_build_agent_name)])

    with only_these_environment_variables_set(env):
        env_info = collect_env_info()

    eq_(env_info.build_agent_name, custom_build_agent_name)
コード例 #17
0
def test_custom_build_agent_name():
    """
    Test that setting a custom BUILD_AGENT_NAME works.
    """
    custom_build_agent_name = 'Agent Smith'

    env = dict(
        ALL_REQ_ENV_VARS.items() + [
            ('BUILD_AGENT_NAME', custom_build_agent_name)])

    with only_these_environment_variables_set(env):
        env_info = collect_env_info()

    eq_(env_info.build_agent_name, custom_build_agent_name)
コード例 #18
0
def standard_sdist_run(submodule_order=None, integration_tests_fn=None):
    args = _parse_args(sys.argv[1:])

    env_info = collect_env_info() if args.publish else None
    verify_cert = not args.no_cert_verify

    if submodule_order:
        execute_submodule_run(submodule_order)

        if not args.skip_int_tests and integration_tests_fn:
            integration_tests_fn()

        if args.publish:
            deploy_all_modules(module_order=submodule_order,
                               env_info=env_info,
                               verify_cert=verify_cert)
    else:
        execute_sdist_run()

        if not args.skip_int_tests and integration_tests_fn:
            integration_tests_fn()

        if args.publish:
            deploy_module(env_info=env_info, verify_cert=verify_cert)