Exemplo n.º 1
0
def main():
    install_simple_logging(logger=logging)
    options = options_handler()
    server_url = 'https://{}'
    server = options.server if options.server.startswith(
        'http') else server_url.format(options.server)
    username = options.user
    password = options.password
    content_zip_path = options.content_zip
    update_content(content_zip_path, server, username, password)
Exemplo n.º 2
0
def main():
    install_simple_logging()
    build = Build(options_handler())
    prints_manager = ParallelPrintsManager(1)

    configure_servers_and_restart(build, prints_manager)
    #  Get a list of the test we need to run.
    tests_for_iteration = get_tests(build)
    #  Installing the packs.
    installed_content_packs_successfully = install_packs_private(
        build, prints_manager)
    #  Get a list of the integrations that have changed.
    new_integrations, modified_integrations = get_changed_integrations(build)
    #  Configuring the instances which are used in testing.
    all_module_instances, brand_new_integrations = \
        configure_server_instances(build, tests_for_iteration, new_integrations, modified_integrations)

    #  Running the instance tests (pushing the test button)
    successful_tests_pre, failed_tests_pre = instance_testing(
        build, all_module_instances, pre_update=True)
    #  Adding the new integrations to the instance test list and testing them.
    all_module_instances.extend(brand_new_integrations)
    successful_tests_post, failed_tests_post = instance_testing(
        build, all_module_instances, pre_update=False)
    #  Done running tests so we are disabling the instances.
    disable_instances(build, all_module_instances)
    #  Gather tests to add to test pack
    test_playbooks_from_id_set = build.id_set.get('TestPlaybooks', [])
    tests_to_add_to_test_pack = find_needed_test_playbook_paths(
        test_playbooks=test_playbooks_from_id_set,
        tests_to_run=build.tests_to_run,
        path_to_content=build.content_root)
    #  Write the test pack
    private_content_test_zip = write_test_pack_zip(
        zip_destination_dir=build.test_pack_path,
        tests_file_paths=tests_to_add_to_test_pack,
        path_to_content=build.content_root)
    # Create and install private test pack
    install_private_testing_pack(build, private_content_test_zip)

    success = report_tests_status(failed_tests_pre, failed_tests_post,
                                  successful_tests_pre, successful_tests_post,
                                  new_integrations)
    sleep(30)
    if not success or not installed_content_packs_successfully:
        sys.exit(2)
def main():
    install_simple_logging()
    print("Time is: {}\n\n\n".format(datetime.datetime.now()))
    tests_settings = options_handler()
    manage_tests(tests_settings)
Exemplo n.º 4
0
        json={
            'channel':
            'dmst-content-lab',
            'username':
            '******',
            'as_user':
            '******',
            'text':
            "Detailed list of failing instances could be found in the following link:\n"
            "https://{}-60525392-gh.circle-artifacts.com/0/artifacts/failed_instances.txt"
            .format(build_number)
        })


if __name__ == "__main__":
    install_simple_logging()
    options = options_handler()
    if options.instance_tests:
        with open('./env_results.json', 'r') as json_file:
            env_results = json.load(json_file)
            server = SERVER_URL.format(env_results[0]["InstanceDNS"])

        slack_notifier(options.slack, options.secret, server, options.user,
                       options.password, options.buildUrl, options.buildNumber)
        # create this file for destroy_instances script
        with open(
                "./Tests/is_build_passed_{}.txt".format(
                    env_results[0]["Role"].replace(' ', '')), 'a'):
            pass
    else:
        logging.error(