diff --git a/app/jmeter/confluence.jmx b/app/jmeter/confluence.jmx index 3b22e2aca..97b604f2c 100644 --- a/app/jmeter/confluence.jmx +++ b/app/jmeter/confluence.jmx @@ -253,7 +253,7 @@ if ("NOT_FOUND".equals(loginform)) { - + ${__groovy(vars.get("legacy_login_form") == 'false')} false true @@ -301,7 +301,7 @@ if ("NOT_FOUND".equals(loginform)) { - + ${__groovy(vars.get("legacy_login_form") == 'true')} false true @@ -498,7 +498,7 @@ vars.put("confluence-version-number", "" + (versionNumbers[0 - + true -1 @@ -527,17 +527,6 @@ vars.put("confluence-version-number", "" + (versionNumbers[0 page_id,space_key - - datasets/confluence/cqls.csv - UTF-8 - , - cql_var - true - false - true - false - - , @@ -1486,7 +1475,7 @@ if ( sleep_time > 0 ) { - + 1 false 1 @@ -1556,7 +1545,136 @@ if ( sleep_time > 0 ) { - + + true + false + + + + ${application.postfix}/rest/api/search + true + GET + true + false + + + + true + cql + siteSearch~"confluence agreement" + = + true + + + false + 0 + = + true + start + + + false + 20 + = + true + limit + + + + + + + + + Accept-Language + en-US,en;q=0.5 + + + X-Requested-With + XMLHttpRequest + + + Accept-Encoding + gzip, deflate + + + Accept + application/json, text/javascript, */*; q=0.01 + + + + + + + {"results":[ + + + Assertion.response_data + false + 16 + + + + + + 1 + 0 + 0 + + + + true + + + // concurrency +def concurrency = ctx.getThreadGroup().getNumThreads() + +// Delays between each action in milli-seconds +def delay_between_transactions = (1000 * 3600) / (vars.get("total_actions_per_hr").toDouble() / concurrency.toDouble()) + +//Sets the pacing length based on the last requests response time. x is the time in ms +def start_time = Long.valueOf(vars.get("loop_start_time")) +def sleep_time = (delay_between_transactions - (System.currentTimeMillis() - start_time)) as int +def action_time = delay_between_transactions - sleep_time as int +def thread_number = ${__threadNum} as int + +log.info("concurrency: " + concurrency + ", delay_between_transactions: " + delay_between_transactions + ", thread_sleep: " + sleep_time + ", thread_number: " + thread_number + ", jmeter_search_cql action_time: " + action_time) + +if ( sleep_time > 0 ) { + return sleep_time +} else { + return 0 +} + + groovy + + + + + + 1 + false + 1 + ${perc_search_cql} + + + + 1 + 0 + 0 + + + + true + + + vars.put("loop_start_time",String.valueOf(System.currentTimeMillis())); + + groovy + + + + true false @@ -1572,7 +1690,7 @@ if ( sleep_time > 0 ) { true cql - siteSearch~'${cql_var}' + siteSearch~"shoulder trip discussion" = true @@ -5367,7 +5485,7 @@ if ( sleep_time > 0 ) { - + app_specific_username @@ -5382,13 +5500,13 @@ if ( sleep_time > 0 ) { - + ${__groovy(vars.get("legacy_login_form") == 'false')} false true - + 2sv login flow ${application.postfix}/rest/tsv/1.0/authenticate POST @@ -5409,7 +5527,7 @@ if ( sleep_time > 0 ) { - + Content-Type @@ -5418,7 +5536,7 @@ if ( sleep_time > 0 ) { - + 200 @@ -5428,7 +5546,7 @@ if ( sleep_time > 0 ) { 2 - + groovy @@ -5436,7 +5554,7 @@ if ( sleep_time > 0 ) { vars.put("run_as_specific_user", "true") - + groovy @@ -5446,13 +5564,13 @@ if ( sleep_time > 0 ) { - + ${__groovy(vars.get("legacy_login_form") == 'true')} false true - + Detected the start of a redirect chain ${application.postfix}/dologin.action POST @@ -5499,7 +5617,7 @@ if ( sleep_time > 0 ) { - + Accept-Language @@ -5534,7 +5652,7 @@ if ( sleep_time > 0 ) { 2 - + groovy @@ -5542,7 +5660,7 @@ if ( sleep_time > 0 ) { vars.put("run_as_specific_user", "true") - + groovy @@ -5552,7 +5670,7 @@ if ( sleep_time > 0 ) { - + ${application.postfix}/rest/api/user/current true GET @@ -5563,7 +5681,7 @@ if ( sleep_time > 0 ) { - + groovy @@ -5587,7 +5705,7 @@ if (response_data.username != vars.get("app_specific_username")) { - + true false @@ -5635,7 +5753,7 @@ if (response_data.username != vars.get("app_specific_username")) { - + ${application.postfix}/app/post_endpoint true GET @@ -5673,19 +5791,19 @@ if (response_data.username != vars.get("app_specific_username")) { - + ${run_as_specific_user} false true - + ${__groovy(vars.get("legacy_login_form") == 'false')} false true - + 2sv login flow ${application.postfix}/rest/tsv/1.0/authenticate POST @@ -5749,7 +5867,7 @@ if (response_data.username != vars.get("app_specific_username")) { true - + Detected the start of a redirect chain ${application.postfix}/dologin.action POST @@ -5849,7 +5967,7 @@ if (response_data.username != vars.get("app_specific_username")) { - + ${application.postfix}/rest/api/user/current true GET @@ -5860,7 +5978,7 @@ if (response_data.username != vars.get("app_specific_username")) { - + groovy @@ -5882,7 +6000,7 @@ if (response_data.username != vars.get("username")) { - + 1 0 0 diff --git a/app/locustio/confluence/http_actions.py b/app/locustio/confluence/http_actions.py index 805e3ec89..3457fba78 100644 --- a/app/locustio/confluence/http_actions.py +++ b/app/locustio/confluence/http_actions.py @@ -12,6 +12,9 @@ logger = init_logger(app_type='confluence') confluence_dataset = confluence_datasets() +TWO_WORDS_CQL = 'confluence agreement' +THREE_WORDS_CQL = 'shoulder trip discussion' + @confluence_measure('locust_login_and_view_dashboard') def login_and_view_dashboard(locust): @@ -402,9 +405,8 @@ def view_blog(locust): catch_response=True) -def search_cql_and_view_results(locust): +def search_cql_two_words_and_view_results(locust): raise_if_login_failed(locust) - cql = random.choice(confluence_dataset["cqls"])[0] @confluence_measure('locust_search_cql:recently_viewed') def search_recently_viewed(): @@ -413,11 +415,11 @@ def search_recently_viewed(): '?limit=8', catch_response=True) - @confluence_measure('locust_search_cql:search_results') + @confluence_measure('locust_search_cql:search_results_2_words') def search_cql(): # 530 rest/api/search r = locust.get(f"/rest/api/search" - f"?cql=siteSearch~'{cql}'" + f"?cql=siteSearch~'{TWO_WORDS_CQL}'" f"&start=0" f"&limit=20", catch_response=True) @@ -435,6 +437,31 @@ def search_cql(): search_recently_viewed() search_cql() +def search_cql_three_words(locust): + raise_if_login_failed(locust) + + @confluence_measure('locust_search_cql:search_results_3_words') + def search_cql(): + # 530 rest/api/search + r = locust.get(f"/rest/api/search" + f"?cql=siteSearch~'{THREE_WORDS_CQL}'" + f"&start=0" + f"&limit=20", + catch_response=True) + + if '{"results":[' not in r.content.decode('utf-8'): + logger.locust_info(r.content.decode('utf-8')) + content = r.content.decode('utf-8') + if 'results' not in content: + logger.error(f"Search cql failed: {content}") + assert 'results' in content, "Search cql failed." + + # 540 rest/mywork/latest/status/notification/count + locust.get('/rest/mywork/latest/status/notification/count', catch_response=True) + + search_cql() + + def open_editor_and_create_blog(locust): params = CreateBlog() diff --git a/app/locustio/confluence/locustfile.py b/app/locustio/confluence/locustfile.py index 9e9a5ab8e..88a4a7cf5 100644 --- a/app/locustio/confluence/locustfile.py +++ b/app/locustio/confluence/locustfile.py @@ -30,7 +30,11 @@ def view_blog_action(self): @task(config.percentage('search_cql')) def search_cql_action(self): - search_cql_and_view_results(self) + search_cql_two_words_and_view_results(self) + + @task(config.percentage('search_cql')) + def search_cql_action(self): + search_cql_three_words(self) @task(config.percentage('create_blog')) def create_blog_action(self): diff --git a/app/locustio/confluence/requests_params.py b/app/locustio/confluence/requests_params.py index e4d7d26a6..f0a9cd706 100644 --- a/app/locustio/confluence/requests_params.py +++ b/app/locustio/confluence/requests_params.py @@ -1,7 +1,6 @@ # flake8: noqa from locustio.common_utils import read_input_file, BaseResource -from util.project_paths import (CONFLUENCE_PAGES, CONFLUENCE_BLOGS, CONFLUENCE_USERS, CONFLUENCE_STATIC_CONTENT, - CONFLUENCE_CQLS) +from util.project_paths import (CONFLUENCE_PAGES, CONFLUENCE_BLOGS, CONFLUENCE_USERS, CONFLUENCE_STATIC_CONTENT) def confluence_datasets(): @@ -9,7 +8,6 @@ def confluence_datasets(): data_sets["pages"] = read_input_file(CONFLUENCE_PAGES) data_sets["blogs"] = read_input_file(CONFLUENCE_BLOGS) data_sets["users"] = read_input_file(CONFLUENCE_USERS) - data_sets["cqls"] = read_input_file(CONFLUENCE_CQLS) data_sets['static-content'] = read_input_file(CONFLUENCE_STATIC_CONTENT) return data_sets diff --git a/app/selenium_ui/confluence/modules.py b/app/selenium_ui/confluence/modules.py index 4e14d76a4..8acc0c6d1 100644 --- a/app/selenium_ui/confluence/modules.py +++ b/app/selenium_ui/confluence/modules.py @@ -13,7 +13,8 @@ CQLS = "cqls" CUSTOM_PAGES = "custom_pages" BLOGS = "blogs" - +TWO_WORDS_CQL = 'confluence agreement' +THREE_WORDS_CQL = 'shoulder trip discussion' def setup_run_data(datasets): datasets['current_session'] = {} @@ -301,16 +302,22 @@ def sub_measure(): measure() +def cql_search_three_words(webdriver): + return cql_search(webdriver, cql_string=THREE_WORDS_CQL, print_timing_suffix='3_words') + + +def cql_search_two_words(webdriver): + return cql_search(webdriver, cql_string=TWO_WORDS_CQL, print_timing_suffix='2_words') + -def cql_search(webdriver, datasets): - random_cql = random.choice(datasets[CQLS]) +def cql_search(webdriver, cql_string, print_timing_suffix): page = Page(webdriver) page.wait_until_visible(PageLocators.search_box) PopupManager(webdriver).dismiss_default_popup() - @print_timing("selenium_cql_search") + @print_timing(f"selenium_cql_search_{print_timing_suffix}") def measure(): - page.get_element(PageLocators.search_box).send_keys(random_cql) + page.get_element(PageLocators.search_box).send_keys(cql_string) page.wait_until_any_ec_presented((PageLocators.empty_search_results, PageLocators.search_results), timeout=30) page.get_element(PageLocators.close_search_button).click() diff --git a/app/selenium_ui/confluence_ui.py b/app/selenium_ui/confluence_ui.py index 49b3e9fee..a723b767d 100644 --- a/app/selenium_ui/confluence_ui.py +++ b/app/selenium_ui/confluence_ui.py @@ -22,7 +22,6 @@ def test_1_selenium_view_page(confluence_webdriver, confluence_datasets, conflue def test_1_selenium_view_page_from_cache(confluence_webdriver, confluence_datasets, confluence_screen_shots): modules.view_page_from_cache(confluence_webdriver, confluence_datasets) - def test_1_selenium_create_page(confluence_webdriver, confluence_datasets, confluence_screen_shots): modules.create_confluence_page(confluence_webdriver, confluence_datasets) @@ -31,6 +30,10 @@ def test_1_selenium_edit_by_url(confluence_webdriver, confluence_datasets, confl modules.edit_confluence_page_by_url(confluence_webdriver, confluence_datasets) +def test_1_selenium_cql_search_two_words(confluence_webdriver, confluence_datasets, confluence_screen_shots): + modules.cql_search_two_words(confluence_webdriver) + + def test_1_selenium_edit_page_quick_edit(confluence_webdriver, confluence_datasets, confluence_screen_shots): modules.edit_confluence_page_quick_edit(confluence_webdriver, confluence_datasets) @@ -39,8 +42,9 @@ def test_1_selenium_create_inline_comment(confluence_webdriver, confluence_datas modules.create_inline_comment(confluence_webdriver, confluence_datasets) -def test_1_selenium_cql_search(confluence_webdriver, confluence_datasets, confluence_screen_shots): - modules.cql_search(confluence_webdriver, confluence_datasets) +def test_1_selenium_cql_search_three_words(confluence_webdriver, confluence_datasets, confluence_screen_shots): + modules.cql_search_three_words(confluence_webdriver) + """ diff --git a/app/selenium_ui/conftest.py b/app/selenium_ui/conftest.py index 4b50489a2..4006b9e85 100644 --- a/app/selenium_ui/conftest.py +++ b/app/selenium_ui/conftest.py @@ -24,7 +24,7 @@ BITBUCKET_PROJECTS, BITBUCKET_REPOS, BITBUCKET_PRS, CONFLUENCE_BLOGS, CONFLUENCE_PAGES, CONFLUENCE_CUSTOM_PAGES, \ CONFLUENCE_USERS, ENV_TAURUS_ARTIFACT_DIR, JSM_DATASET_REQUESTS, JSM_DATASET_CUSTOMERS, JSM_DATASET_AGENTS, \ JSM_DATASET_SERVICE_DESKS_L, JSM_DATASET_SERVICE_DESKS_M, JSM_DATASET_SERVICE_DESKS_S, JSM_DATASET_CUSTOM_ISSUES, \ - JSM_DATASET_INSIGHT_SCHEMAS, JSM_DATASET_INSIGHT_ISSUES, BAMBOO_USERS, BAMBOO_BUILD_PLANS, CONFLUENCE_CQLS + JSM_DATASET_INSIGHT_SCHEMAS, JSM_DATASET_INSIGHT_ISSUES, BAMBOO_USERS, BAMBOO_BUILD_PLANS SCREEN_WIDTH = 1920 SCREEN_HEIGHT = 1080 @@ -87,7 +87,6 @@ def confluence_dataset(self): self.dataset["pages"] = self.__read_input_file(CONFLUENCE_PAGES) self.dataset["blogs"] = self.__read_input_file(CONFLUENCE_BLOGS) self.dataset["users"] = self.__read_input_file(CONFLUENCE_USERS) - self.dataset["cqls"] = self.__read_input_file(CONFLUENCE_CQLS) self.dataset["custom_pages"] = self.__read_input_file( CONFLUENCE_CUSTOM_PAGES) return self.dataset diff --git a/app/util/data_preparation/confluence_prepare_data.py b/app/util/data_preparation/confluence_prepare_data.py index 0bec9c027..5be5167ae 100644 --- a/app/util/data_preparation/confluence_prepare_data.py +++ b/app/util/data_preparation/confluence_prepare_data.py @@ -8,7 +8,7 @@ from util.api.confluence_clients import ConfluenceRpcClient, ConfluenceRestClient from util.common_util import print_timing from util.conf import CONFLUENCE_SETTINGS -from util.project_paths import (CONFLUENCE_USERS, CONFLUENCE_PAGES, CONFLUENCE_BLOGS, CONFLUENCE_CQLS, +from util.project_paths import (CONFLUENCE_USERS, CONFLUENCE_PAGES, CONFLUENCE_BLOGS, CONFLUENCE_CUSTOM_PAGES, CONFLUENCE_WORDS) __warnings_filter() @@ -76,8 +76,6 @@ def __create_data_set(rest_client, rpc_client): dataset[PAGES] = async_pages.get() dataset[BLOGS] = async_blogs.get() - dataset[CQLS] = __generate_cqls(words_count=CQL_WORDS_COUNT) - dataset[CUSTOM_PAGES] = __get_custom_pages(perf_user_api, 5000, CONFLUENCE_SETTINGS.custom_dataset_query) print(f'Users count: {len(dataset[USERS])}') print(f'Pages count: {len(dataset[PAGES])}') @@ -211,8 +209,6 @@ def write_test_data_to_files(dataset): users = [f"{user['user']['username']},{DEFAULT_USER_PASSWORD}" for user in dataset[USERS]] __write_to_file(CONFLUENCE_USERS, users) - __write_to_file(CONFLUENCE_CQLS, dataset[CQLS]) - custom_pages = [f"{page['id']},{page['space']['key']}" for page in dataset[CUSTOM_PAGES]] __write_to_file(CONFLUENCE_CUSTOM_PAGES, custom_pages) diff --git a/app/util/default_test_actions.json b/app/util/default_test_actions.json index 6321e0396..8c07a9eaa 100644 --- a/app/util/default_test_actions.json +++ b/app/util/default_test_actions.json @@ -87,7 +87,8 @@ "selenium_create_comment", "selenium_create_comment:write_comment", "selenium_create_comment:save_comment", - "selenium_cql_search", + "selenium_cql_search_two_words", + "selenium_cql_search_three_words", "selenium_log_out" ], "jmeter": [ @@ -95,7 +96,8 @@ "jmeter_view_page:open_page", "jmeter_view_blog", "jmeter_search_cql:recently_viewed", - "jmeter_search_cql:search_results", + "jmeter_search_cql:search_results_2_words", + "jmeter_search_cql:search_results_3_words", "jmeter_view_dashboard", "jmeter_create_and_edit_page:create_page_editor", "jmeter_create_and_edit_page:create_page", @@ -116,7 +118,8 @@ "locust_view_dashboard", "locust_view_blog", "locust_search_cql:recently_viewed", - "locust_search_cql:search_results", + "locust_search_cql:search_results_3_words", + "locust_search_cql:search_results_2_words", "locust_comment_page", "locust_create_and_edit_page:create_page_editor", "locust_create_and_edit_page:create_page", diff --git a/app/util/project_paths.py b/app/util/project_paths.py index a439fab3b..f4ba35504 100644 --- a/app/util/project_paths.py +++ b/app/util/project_paths.py @@ -121,7 +121,6 @@ def __get_default_test_actions(): CONFLUENCE_USERS = __get_confluence_dataset('users.csv') CONFLUENCE_PAGES = __get_confluence_dataset('pages.csv') CONFLUENCE_BLOGS = __get_confluence_dataset('blogs.csv') -CONFLUENCE_CQLS = __get_confluence_dataset('cqls.csv') CONFLUENCE_STATIC_CONTENT = __get_confluence_dataset('static-content/files_upload.csv') CONFLUENCE_CUSTOM_PAGES = __get_confluence_dataset('custom_pages.csv') CONFLUENCE_WORDS = __get_confluence_dataset('static-content/words.csv')