<commit_before>#!/bin/bash -e

create_activate_and_cd_virtualenv()
{
	echo "### Creating virtualenv"
	virtualenv env
	source env/bin/activate
	cd env
}

setenv()
{
	export BRANCH_NAME_CORE=${BRANCH_NAME_CORE='3.2m1'}
	export BRANCH_NAME_PLUGINS=${BRANCH_NAME_PLUGINS='1.2m1'}
	BRANCH_NAME_OPENSTACK_PROVIDER=${BRANCH_NAME_OPENSTACK_PROVIDER=${BRANCH_NAME_PLUGINS}}
	BRANCH_NAME_LIBCLOUD_PROVIDER=${BRANCH_NAME_LIBCLOUD_PROVIDER=${BRANCH_NAME_PLUGINS}}
	BRANCH_NAME_VSPHERE_PLUGIN=${BRANCH_NAME_VSPHERE_PLUGIN=${BRANCH_NAME_PLUGINS}}
	BRANCH_NAME_CLI=${BRANCH_NAME_CLI=${BRANCH_NAME_CORE}}
	BRANCH_NAME_MANAGER_BLUEPRINTS=${BRANCH_NAME_MANAGER_BLUEPRINTS=${BRANCH_NAME_CORE}}

	# injected by quickbuild
	BRANCH_NAME_SYSTEM_TESTS=${BRANCH_NAME_SYSTEM_TESTS=${BRANCH_NAME_CORE}}
	NOSETESTS_TO_RUN=${NOSETESTS_TO_RUN='cosmo_tester/test_suites'}
	OPENCM_GIT_PWD=${OPENCM_GIT_PWD}

	# for documentation purposes, injected by quickbuild, used by `update_config.py`
	# KEYSTONE_PASSWORD=
	# KEYSTONE_USERNAME=
	# KEYSTONE_TENTANT=
   	# KEYSTONE_AUTH_URL=
	# RESOURCE_PREFIX=
	# COMPONENTS_PACKAGE_URL=
	# CORE_PACKAGE_URL=
	# UBUNTU_PACKAGE_URL=
	# CENTOS_PACKAGE_URL=
	# WINDOWS_PACKAGE_URL=
	# UI_PACKAGE_URL=
	# DOCKER_IMAGE_URL=

	BOOTSTRAP_USING_PROVIDERS=${BOOTSTRAP_USING_PROVIDERS=false}
	CLOUDIFY_CONFIG_SUFFIX=$([ "${BOOTSTRAP_USING_PROVIDERS}" == "false" ] && echo "json" || echo "yaml")

	# vagrant synched folder
	SUITE_NAME=${SUITE_NAME='default-suite'}
	BASE_HOST_DIR="/vagrant"
	BASE_CONFIG_DIR="${BASE_HOST_DIR}/configurations"
	REPORT_FILE="${BASE_HOST_DIR}/xunit-reports/${SUITE_NAME}-report.xml"
	CLOUDIFY_TEST_CONFIG=${CLOUDIFY_TEST_CONFIG='cloudify-config-openstack-on-hp.yaml'}
	ORIGINAL_CLOUDIFY_TEST_CONFIG_PATH="${BASE_CONFIG_DIR}/${CLOUDIFY_TEST_CONFIG}"

	# base dir is the virtualenv directory
	BASE_DIR=$PWD
	SYSTEM_TESTS_DIR="${BASE_DIR}/cloudify-system-tests"
	GENERATED_CLOUDIFY_TEST_CONFIG_PATH="${BASE_DIR}/generated-cloudify-config.${CLOUDIFY_CONFIG_SUFFIX}"

	# So that we get to see output faster from docker-logs
	export PYTHONUNBUFFERED="true"

	# export system tests related variables
	export CLOUDIFY_TEST_CONFIG_PATH=${GENERATED_CLOUDIFY_TEST_CONFIG_PATH}
	export CLOUDIFY_TEST_HANDLER_MODULE=${CLOUDIFY_TEST_HANDLER_MODULE='cosmo_tester.framework.handlers.openstack'}
	export BOOTSTRAP_USING_PROVIDERS=${BOOTSTRAP_USING_PROVIDERS}
	export WORKFLOW_TASK_RETRIES=${WORKFLOW_TASK_RETRIES=20}
	export CLOUDIFY_AUTOMATION_TOKEN=${CLOUDIFY_AUTOMATION_TOKEN}
	# If handler is vsphere set the manager dir to the plugin's directory
	if [[ "${CLOUDIFY_TEST_HANDLER_MODULE}" = "cosmo_tester.framework.handlers.vsphere" ]]; then
		export MANAGER_BLUEPRINTS_DIR="${BASE_DIR}/cloudify-vsphere-plugin"
    	else
		export MANAGER_BLUEPRINTS_DIR="${BASE_DIR}/cloudify-manager-blueprints"
	fi
	
	export BOOTSTRAP_USING_DOCKER=${BOOTSTRAP_USING_DOCKER=true}
    export USE_EXTERNAL_AGENT_PACKAGES=${USE_EXTERNAL_AGENT_PACKAGES=true}
}

clone_and_install_system_tests()
{
	echo "### Cloning system tests repository and dependencies"
	clone_and_checkout cloudify-system-tests ${BRANCH_NAME_SYSTEM_TESTS}
	clone_and_checkout cloudify-cli ${BRANCH_NAME_CLI}
	clone_and_checkout cloudify-openstack-provider ${BRANCH_NAME_OPENSTACK_PROVIDER}
	clone_and_checkout cloudify-libcloud-provider ${BRANCH_NAME_LIBCLOUD_PROVIDER}
	clone_and_checkout cloudify-manager-blueprints ${BRANCH_NAME_MANAGER_BLUEPRINTS}
	clone_and_checkout cloudify-vsphere-plugin ${BRANCH_NAME_VSPHERE_PLUGIN} Gigaspaces private

	echo "### Installing system tests dependencies"
	pip install ./cloudify-cli -r cloudify-cli/dev-requirements.txt
	pip install ./cloudify-openstack-provider
	pip install ./cloudify-libcloud-provider
	pip install ./cloudify-vsphere-plugin
	pip install -e ./cloudify-system-tests
}

clone_and_checkout()
{
	local repo_name=$1
	local branch_name=$2
	local base_repo_url="https://github.com/"
	local organization="cloudify-cosmo"
	local custom_organization=$3
	if [[ -n "$3" ]]
	then
		organization=${custom_organization}
	fi<commit_msg>removed custom agent packages variable 2<commit_after>#!/bin/bash -e

create_activate_and_cd_virtualenv()
{
	echo "### Creating virtualenv"
	virtualenv env
	source env/bin/activate
	cd env
}

setenv()
{
	export BRANCH_NAME_CORE=${BRANCH_NAME_CORE='3.2m1'}
	export BRANCH_NAME_PLUGINS=${BRANCH_NAME_PLUGINS='1.2m1'}
	BRANCH_NAME_OPENSTACK_PROVIDER=${BRANCH_NAME_OPENSTACK_PROVIDER=${BRANCH_NAME_PLUGINS}}
	BRANCH_NAME_LIBCLOUD_PROVIDER=${BRANCH_NAME_LIBCLOUD_PROVIDER=${BRANCH_NAME_PLUGINS}}
	BRANCH_NAME_VSPHERE_PLUGIN=${BRANCH_NAME_VSPHERE_PLUGIN=${BRANCH_NAME_PLUGINS}}
	BRANCH_NAME_CLI=${BRANCH_NAME_CLI=${BRANCH_NAME_CORE}}
	BRANCH_NAME_MANAGER_BLUEPRINTS=${BRANCH_NAME_MANAGER_BLUEPRINTS=${BRANCH_NAME_CORE}}

	# injected by quickbuild
	BRANCH_NAME_SYSTEM_TESTS=${BRANCH_NAME_SYSTEM_TESTS=${BRANCH_NAME_CORE}}
	NOSETESTS_TO_RUN=${NOSETESTS_TO_RUN='cosmo_tester/test_suites'}
	OPENCM_GIT_PWD=${OPENCM_GIT_PWD}

	# for documentation purposes, injected by quickbuild, used by `update_config.py`
	# KEYSTONE_PASSWORD=
	# KEYSTONE_USERNAME=
	# KEYSTONE_TENTANT=
   	# KEYSTONE_AUTH_URL=
	# RESOURCE_PREFIX=
	# COMPONENTS_PACKAGE_URL=
	# CORE_PACKAGE_URL=
	# UBUNTU_PACKAGE_URL=
	# CENTOS_PACKAGE_URL=
	# WINDOWS_PACKAGE_URL=
	# UI_PACKAGE_URL=
	# DOCKER_IMAGE_URL=

	BOOTSTRAP_USING_PROVIDERS=${BOOTSTRAP_USING_PROVIDERS=false}
	CLOUDIFY_CONFIG_SUFFIX=$([ "${BOOTSTRAP_USING_PROVIDERS}" == "false" ] && echo "json" || echo "yaml")

	# vagrant synched folder
	SUITE_NAME=${SUITE_NAME='default-suite'}
	BASE_HOST_DIR="/vagrant"
	BASE_CONFIG_DIR="${BASE_HOST_DIR}/configurations"
	REPORT_FILE="${BASE_HOST_DIR}/xunit-reports/${SUITE_NAME}-report.xml"
	CLOUDIFY_TEST_CONFIG=${CLOUDIFY_TEST_CONFIG='cloudify-config-openstack-on-hp.yaml'}
	ORIGINAL_CLOUDIFY_TEST_CONFIG_PATH="${BASE_CONFIG_DIR}/${CLOUDIFY_TEST_CONFIG}"

	# base dir is the virtualenv directory
	BASE_DIR=$PWD
	SYSTEM_TESTS_DIR="${BASE_DIR}/cloudify-system-tests"
	GENERATED_CLOUDIFY_TEST_CONFIG_PATH="${BASE_DIR}/generated-cloudify-config.${CLOUDIFY_CONFIG_SUFFIX}"

	# So that we get to see output faster from docker-logs
	export PYTHONUNBUFFERED="true"

	# export system tests related variables
	export CLOUDIFY_TEST_CONFIG_PATH=${GENERATED_CLOUDIFY_TEST_CONFIG_PATH}
	export CLOUDIFY_TEST_HANDLER_MODULE=${CLOUDIFY_TEST_HANDLER_MODULE='cosmo_tester.framework.handlers.openstack'}
	export BOOTSTRAP_USING_PROVIDERS=${BOOTSTRAP_USING_PROVIDERS}
	export WORKFLOW_TASK_RETRIES=${WORKFLOW_TASK_RETRIES=20}
	export CLOUDIFY_AUTOMATION_TOKEN=${CLOUDIFY_AUTOMATION_TOKEN}
	# If handler is vsphere set the manager dir to the plugin's directory
	if [[ "${CLOUDIFY_TEST_HANDLER_MODULE}" = "cosmo_tester.framework.handlers.vsphere" ]]; then
		export MANAGER_BLUEPRINTS_DIR="${BASE_DIR}/cloudify-vsphere-plugin"
    	else
		export MANAGER_BLUEPRINTS_DIR="${BASE_DIR}/cloudify-manager-blueprints"
	fi
	
	export BOOTSTRAP_USING_DOCKER=${BOOTSTRAP_USING_DOCKER=true}
}

clone_and_install_system_tests()
{
	echo "### Cloning system tests repository and dependencies"
	clone_and_checkout cloudify-system-tests ${BRANCH_NAME_SYSTEM_TESTS}
	clone_and_checkout cloudify-cli ${BRANCH_NAME_CLI}
	clone_and_checkout cloudify-openstack-provider ${BRANCH_NAME_OPENSTACK_PROVIDER}
	clone_and_checkout cloudify-libcloud-provider ${BRANCH_NAME_LIBCLOUD_PROVIDER}
	clone_and_checkout cloudify-manager-blueprints ${BRANCH_NAME_MANAGER_BLUEPRINTS}
	clone_and_checkout cloudify-vsphere-plugin ${BRANCH_NAME_VSPHERE_PLUGIN} Gigaspaces private

	echo "### Installing system tests dependencies"
	pip install ./cloudify-cli -r cloudify-cli/dev-requirements.txt
	pip install ./cloudify-openstack-provider
	pip install ./cloudify-libcloud-provider
	pip install ./cloudify-vsphere-plugin
	pip install -e ./cloudify-system-tests
}

clone_and_checkout()
{
	local repo_name=$1
	local branch_name=$2
	local base_repo_url="https://github.com/"
	local organization="cloudify-cosmo"
	local custom_organization=$3
	if [[ -n "$3" ]]
	then
		organization=${custom_organization}
	fi
{'fraction_non_alphanumeric': 0.10363274446379696, 'fraction_numerical': 0.0031102264244837023, 'mean_word_length': 8.47995283018868, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7113128', 'n_tokens_mistral': 3238, 'n_tokens_neox': 3153, 'n_words': 394}