Skip to content

Commit

Permalink
no bug - Configure CircleCI to break the selenium UI tests up to dras…
Browse files Browse the repository at this point in the history
…tically decrease total run time
  • Loading branch information
dklawren committed May 12, 2023
1 parent 01a9d86 commit 60de0a9
Show file tree
Hide file tree
Showing 44 changed files with 119 additions and 20 deletions.
114 changes: 103 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ jobs:
command: |
[[ -f build_info/only_version_changed.txt ]] && exit 0
docker-compose -f docker-compose.test.yml run --no-deps bmo.test \
test_sanity t/*.t extensions/*/t/*.t | tee artifacts/$CIRCLE_JOB.txt
test_sanity t/*.t extensions/*/t/*.t
- store_artifacts:
path: /app/artifacts
- *store_log
Expand All @@ -193,15 +193,42 @@ jobs:
[[ -d artifacts ]] || mkdir artifacts
- attach_workspace:
at: /app/build_info
- run:
name: run webservice tests
command: |
[[ -f build_info/only_version_changed.txt ]] && exit 0
docker-compose -f docker-compose.test.yml run bmo.test test_webservices
- store_artifacts:
path: /app/artifacts
- *store_log

test_selenium_1:
parallelism: 1
working_directory: /app
docker:
- *docker_image
steps:
- setup_remote_docker:
version: 19.03.13
docker_layer_caching: true
- checkout
- *install_docker_compose
- *docker_login
- *build_image
- run: |
[[ -f build_info/only_version_changed.txt ]] && exit 0
docker-compose -f docker-compose.test.yml run bmo.test test_webservices | \
tee artifacts/$CIRCLE_JOB.txt
[[ -d artifacts ]] || mkdir artifacts
- attach_workspace:
at: /app/build_info
- run:
name: run selenium tests
command: |
[[ -f build_info/only_version_changed.txt ]] && exit 0
docker-compose -f docker-compose.test.yml run -e SELENIUM_GROUP=1 bmo.test test_selenium
- store_artifacts:
path: /app/artifacts
- *store_log

test_selenium:
test_selenium_2:
parallelism: 1
working_directory: /app
docker:
Expand All @@ -218,10 +245,63 @@ jobs:
[[ -d artifacts ]] || mkdir artifacts
- attach_workspace:
at: /app/build_info
- run:
name: run selenium tests
command: |
[[ -f build_info/only_version_changed.txt ]] && exit 0
docker-compose -f docker-compose.test.yml run -e SELENIUM_GROUP=2 bmo.test test_selenium 2
- store_artifacts:
path: /app/artifacts
- *store_log

test_selenium_3:
parallelism: 1
working_directory: /app
docker:
- *docker_image
steps:
- setup_remote_docker:
version: 19.03.13
docker_layer_caching: true
- checkout
- *install_docker_compose
- *docker_login
- *build_image
- run: |
[[ -f build_info/only_version_changed.txt ]] && exit 0
docker-compose -f docker-compose.test.yml run bmo.test test_selenium | \
tee artifacts/$CIRCLE_JOB.txt
[[ -d artifacts ]] || mkdir artifacts
- attach_workspace:
at: /app/build_info
- run:
name: run selenium tests
command: |
[[ -f build_info/only_version_changed.txt ]] && exit 0
docker-compose -f docker-compose.test.yml run -e SELENIUM_GROUP=3 bmo.test test_selenium 3
- store_artifacts:
path: /app/artifacts
- *store_log

test_selenium_4:
parallelism: 1
working_directory: /app
docker:
- *docker_image
steps:
- setup_remote_docker:
version: 19.03.13
docker_layer_caching: true
- checkout
- *install_docker_compose
- *docker_login
- *build_image
- run: |
[[ -d artifacts ]] || mkdir artifacts
- attach_workspace:
at: /app/build_info
- run:
name: run selenium tests
command: |
[[ -f build_info/only_version_changed.txt ]] && exit 0
docker-compose -f docker-compose.test.yml run -e SELENIUM_GROUP=4 bmo.test test_selenium 4
- store_artifacts:
path: /app/artifacts
- *store_log
Expand All @@ -248,7 +328,7 @@ jobs:
command: |
[[ -f build_info/only_version_changed.txt ]] && exit 0
docker-compose -f docker-compose.test.yml run bmo.test test_bmo \
-q -f t/bmo/*.t extensions/*/t/bmo/*.t | tee artifacts/$CIRCLE_JOB.txt
-q -f t/bmo/*.t extensions/*/t/bmo/*.t
- *store_log

workflows:
Expand All @@ -262,7 +342,10 @@ workflows:
- test_sanity
- test_bmo
- test_webservices
- test_selenium
- test_selenium_1
- test_selenium_2
- test_selenium_3
- test_selenium_4
- test_sanity:
requires:
- build
Expand All @@ -272,6 +355,15 @@ workflows:
- test_webservices:
requires:
- build
- test_selenium:
- test_selenium_1:
requires:
- build
- test_selenium_2:
requires:
- build
- test_selenium_3:
requires:
- build
- test_selenium_4:
requires:
- build
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 11 additions & 8 deletions qa/t/test_security.t → qa/t/3_test_security.t
Original file line number Diff line number Diff line change
Expand Up @@ -132,22 +132,25 @@ $sel->check_ok('//input[@name="groups" and @value="Master"]');
my $bug2_id = create_bug($sel, $bug_summary2);

go_to_bug($sel, $bug1_id);
$sel->is_text_present_ok("secret_qa_bug_$bug2_id");
$sel->is_element_present_ok("link=secret_qa_bug_$bug2_id");
logout($sel);

log_in($sel, $config, 'editbugs');
go_to_bug($sel, $bug1_id);
ok(!$sel->is_text_present("secret_qa_bug_$bug2_id"),
"The alias 'secret_qa_bug_$bug2_id' is not visible for editbugs users");
ok($sel->is_text_present($bug2_id),
"But the bug ID is visible for editbugs users");
ok(
!$sel->is_element_present("link=secret_qa_bug_$bug2_id"),
"The alias 'secret_qa_bug_$bug2_id' is not visible for editbugs users"
);
$sel->is_element_present_ok("link=$bug2_id");
logout($sel);

go_to_bug($sel, $bug1_id, 1);
ok(!$sel->is_text_present("secret_qa_bug_$bug2_id"),
ok(!$sel->is_element_present("link=secret_qa_bug_$bug2_id"),
"The alias 'secret_qa_bug_$bug2_id' is not visible for logged out users");
ok(!$sel->is_text_present($bug2_id),
"Even the bug ID is not visible for logged out users");
ok(
!$sel->is_element_present("link=$bug2_id"),
"Even the bug ID is not visible for logged out users"
);

#######################################################################
# Security bug 472206.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 5 additions & 1 deletion scripts/entrypoint.pl
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ sub cmd_test_webservices {
}

sub cmd_test_selenium {
cmd_test_qa('test_*.t');
my $file_pattern = '*test_*.t';
if ($ENV{SELENIUM_GROUP}) {
$file_pattern = $ENV{SELENIUM_GROUP} . '_test_*.t';
}
cmd_test_qa($file_pattern);
}

sub cmd_test_qa {
Expand Down

0 comments on commit 60de0a9

Please sign in to comment.