diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9cdfa8b220..b7f00ba29d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,6 @@ name: BMO Test Suite -on: - pull_request +on: pull_request jobs: test_sanity: @@ -13,7 +12,7 @@ jobs: - name: Build Docker test images run: docker-compose -f docker-compose.test.yml build bmo.test - name: Run sanity tests - run: docker-compose -f docker-compose.test.yml run --no-deps bmo.test test_sanity t/*.t extensions/*/t/*.t + run: docker-compose -f docker-compose.test.yml run --no-deps bmo.test test_sanity -qf t/*.t extensions/*/t/*.t test_webservices: runs-on: ubuntu-latest @@ -24,7 +23,10 @@ jobs: - name: Build Docker test images run: docker-compose -f docker-compose.test.yml build - name: Run webservice tests - run: docker-compose -f docker-compose.test.yml run bmo.test test_webservices + run: | + docker-compose -f docker-compose.test.yml run bmo.test test_webservices -qf \ + qa/t/{webservice,rest}_*.t \ + $(find extensions \( -path "*/qa/t/webservice_*.t" -o -path "*/qa/t/rest_*.t" \)) test_bmo: runs-on: ubuntu-latest @@ -35,7 +37,7 @@ jobs: - name: Build Docker test images run: docker-compose -f docker-compose.test.yml build - name: Run bmo specific tests - run: docker-compose -f docker-compose.test.yml run -e CI=1 bmo.test test_bmo -q -f t/bmo/*.t extensions/*/t/bmo/*.t + run: docker-compose -f docker-compose.test.yml run -e CI=1 bmo.test test_bmo -qf t/bmo/*.t extensions/*/t/bmo/*.t test_selenium_1: runs-on: ubuntu-latest @@ -46,7 +48,10 @@ jobs: - name: Build Docker test images run: docker-compose -f docker-compose.test.yml build - name: Run Selenium tests (1) - run: docker-compose -f docker-compose.test.yml run -e SELENIUM_GROUP=1 bmo.test test_selenium + run: | + docker-compose -f docker-compose.test.yml run bmo.test test_selenium -qf \ + qa/t/1_test_*.t \ + $(find extensions -path "*/qa/t/1_test_*.t") test_selenium_2: runs-on: ubuntu-latest @@ -57,7 +62,10 @@ jobs: - name: Build Docker test images run: docker-compose -f docker-compose.test.yml build - name: Run Selenium tests (2) - run: docker-compose -f docker-compose.test.yml run -e SELENIUM_GROUP=2 bmo.test test_selenium + run: | + docker-compose -f docker-compose.test.yml run bmo.test test_selenium -qf \ + qa/t/2_test_*.t \ + $(find extensions -path "*/qa/t/2_test_*.t") test_selenium_3: runs-on: ubuntu-latest @@ -68,7 +76,10 @@ jobs: - name: Build Docker test images run: docker-compose -f docker-compose.test.yml build - name: Run Selenium tests (3) - run: docker-compose -f docker-compose.test.yml run -e SELENIUM_GROUP=3 bmo.test test_selenium + run: | + docker-compose -f docker-compose.test.yml run bmo.test test_selenium -qf \ + qa/t/3_test_*.t \ + $(find extensions -path "*/qa/t/3_test_*.t") test_selenium_4: runs-on: ubuntu-latest @@ -79,4 +90,7 @@ jobs: - name: Build Docker test images run: docker-compose -f docker-compose.test.yml build - name: Run Selenium tests (4) - run: docker-compose -f docker-compose.test.yml run -e SELENIUM_GROUP=4 bmo.test test_selenium + run: | + docker-compose -f docker-compose.test.yml run bmo.test test_selenium -qf \ + qa/t/4_test_*.t \ + $(find extensions -path "*/qa/t/4_test_*.t") diff --git a/qa/t/lib/QA/REST.pm b/Bugzilla/QA/REST.pm similarity index 92% rename from qa/t/lib/QA/REST.pm rename to Bugzilla/QA/REST.pm index 47ee6834ff..db9d468345 100644 --- a/qa/t/lib/QA/REST.pm +++ b/Bugzilla/QA/REST.pm @@ -5,7 +5,7 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -package QA::REST; +package Bugzillas::QA::REST; use 5.10.1; use strict; @@ -14,11 +14,11 @@ use autodie; use LWP::UserAgent; use JSON; -use QA::Util; +use Bugzilla::QA::Util; use parent qw(LWP::UserAgent Exporter); -@QA::REST::EXPORT = qw( +@Bugzilla::QA::REST::EXPORT = qw( MUST_FAIL get_rest_client ); @@ -27,7 +27,7 @@ use constant MUST_FAIL => 1; sub get_rest_client { my $rest_client = LWP::UserAgent->new(ssl_opts => {verify_hostname => 0}); - bless($rest_client, 'QA::REST'); + bless($rest_client, 'Bugzilla::QA::REST'); my $config = $rest_client->{bz_config} = get_config(); $rest_client->{bz_url} = $config->{browser_url} . '/rest/'; diff --git a/qa/t/lib/QA/RPC.pm b/Bugzilla/QA/RPC.pm similarity index 97% rename from qa/t/lib/QA/RPC.pm rename to Bugzilla/QA/RPC.pm index 92fc755dea..0e367540f6 100644 --- a/qa/t/lib/QA/RPC.pm +++ b/Bugzilla/QA/RPC.pm @@ -7,11 +7,15 @@ # -*- Mode: perl; indent-tabs-mode: nil -*- -package QA::RPC; +package Bugzilla::QA::RPC; + +use 5.10.1; use strict; +use warnings; + use Data::Dumper; -use QA::Util; -use QA::Tests qw(PRIVATE_BUG_USER create_bug_fields); +use Bugzilla::QA::Util; +use Bugzilla::QA::Tests qw(PRIVATE_BUG_USER create_bug_fields); use Storable qw(dclone); use Test::More; @@ -278,7 +282,7 @@ sub bz_test_bug { my $creation_day; # XML-RPC and JSON-RPC have different date formats. - if ($self->isa('QA::RPC::XMLRPC')) { + if ($self->isa('Bugzilla::QA::RPC::XMLRPC')) { $creation_day = $creation_time->ymd(''); } else { diff --git a/qa/t/lib/QA/RPC/JSONRPC.pm b/Bugzilla/QA/RPC/JSONRPC.pm similarity index 90% rename from qa/t/lib/QA/RPC/JSONRPC.pm rename to Bugzilla/QA/RPC/JSONRPC.pm index 3a72ada9d5..b0b110cc4e 100644 --- a/qa/t/lib/QA/RPC/JSONRPC.pm +++ b/Bugzilla/QA/RPC/JSONRPC.pm @@ -7,13 +7,16 @@ # -*- Mode: perl; indent-tabs-mode: nil -*- -package QA::RPC::JSONRPC; +package Bugzilla::QA::RPC::JSONRPC; + +use 5.10.1; use strict; +use warnings; -use QA::RPC; +use Bugzilla::QA::RPC; BEGIN { - our @ISA = qw(QA::RPC); + our @ISA = qw(Bugzilla::QA::RPC); if (eval { require JSON::RPC::Client }) { push(@ISA, 'JSON::RPC::Client'); @@ -39,8 +42,8 @@ sub TYPE { sub ua { my $self = shift; - if ($self->{ua} and not $self->{ua}->isa('QA::RPC::UserAgent')) { - bless $self->{ua}, 'QA::RPC::UserAgent'; + if ($self->{ua} and not $self->{ua}->isa('Bugzilla::QA::RPC::UserAgent')) { + bless $self->{ua}, 'Bugzilla::QA::RPC::UserAgent'; } return $self->SUPER::ua(@_); } @@ -97,7 +100,7 @@ sub call { } if ($result) { - bless $result, 'QA::RPC::JSONRPC::ReturnObject'; + bless $result, 'Bugzilla::QA::RPC::JSONRPC::ReturnObject'; } return $result; } @@ -123,7 +126,7 @@ sub _get { 1; -package QA::RPC::JSONRPC::ReturnObject; +package Bugzilla::QA::RPC::JSONRPC::ReturnObject; use strict; BEGIN { @@ -146,7 +149,7 @@ sub fault { $_[0]->is_error } 1; -package QA::RPC::UserAgent; +package Bugzilla::QA::RPC::UserAgent; use strict; use base qw(LWP::UserAgent); diff --git a/qa/t/lib/QA/RPC/XMLRPC.pm b/Bugzilla/QA/RPC/XMLRPC.pm similarity index 82% rename from qa/t/lib/QA/RPC/XMLRPC.pm rename to Bugzilla/QA/RPC/XMLRPC.pm index 6e63852eb6..eee725e60e 100644 --- a/qa/t/lib/QA/RPC/XMLRPC.pm +++ b/Bugzilla/QA/RPC/XMLRPC.pm @@ -7,9 +7,13 @@ # -*- Mode: perl; indent-tabs-mode: nil -*- -package QA::RPC::XMLRPC; +package Bugzilla::QA::RPC::XMLRPC; + +use 5.10.1; use strict; -use base qw(QA::RPC XMLRPC::Lite); +use warnings; + +use base qw(Bugzilla::QA::RPC XMLRPC::Lite); use constant TYPE => 'XML-RPC'; use constant DATETIME_REGEX => qr/^\d{8}T\d\d:\d\d:\d\d$/; diff --git a/qa/t/lib/QA/Tests.pm b/Bugzilla/QA/Tests.pm similarity index 98% rename from qa/t/lib/QA/Tests.pm rename to Bugzilla/QA/Tests.pm index 92eb40bc1f..5d3a82f967 100644 --- a/qa/t/lib/QA/Tests.pm +++ b/Bugzilla/QA/Tests.pm @@ -7,8 +7,12 @@ # -*- Mode: perl; indent-tabs-mode: nil -*- -package QA::Tests; +package Bugzilla::QA::Tests; + +use 5.10.1; use strict; +use warnings; + use base qw(Exporter); our @EXPORT_OK = qw( PRIVATE_BUG_USER diff --git a/qa/t/lib/QA/Util.pm b/Bugzilla/QA/Util.pm similarity index 97% rename from qa/t/lib/QA/Util.pm rename to Bugzilla/QA/Util.pm index 128caf4915..17b2a9a51f 100644 --- a/qa/t/lib/QA/Util.pm +++ b/Bugzilla/QA/Util.pm @@ -7,9 +7,12 @@ # -*- Mode: perl; indent-tabs-mode: nil -*- -package QA::Util; +package Bugzilla::QA::Util; +use 5.10.1; use strict; +use warnings; + use Data::Dumper; use Test::More; use Test::WWW::Selenium; @@ -34,7 +37,7 @@ BEGIN { } use base qw(Exporter); -@QA::Util::EXPORT = qw( +@Bugzilla::QA::Util::EXPORT = qw( trim url_quote random_string @@ -65,9 +68,8 @@ use base qw(Exporter); ); # How long we wait for pages to load. -use constant WAIT_TIME => 60000; -use constant CONF_FILE => $ENV{BZ_QA_CONF_FILE} - // "../config/selenium_test.conf"; +use constant WAIT_TIME => 60000; +use constant CONF_FILE => $ENV{BZ_QA_CONF_FILE} // "conf/selenium_test.conf"; use constant CHROME_MODE => 1; ##################### @@ -154,15 +156,15 @@ sub get_xmlrpc_client { = $config->{browser_url} . "/xmlrpc.cgi"; - require QA::RPC::XMLRPC; - my $rpc = new QA::RPC::XMLRPC(proxy => $xmlrpc_url); + require Bugzilla::QA::RPC::XMLRPC; + my $rpc = new Bugzilla::QA::RPC::XMLRPC(proxy => $xmlrpc_url); return ($rpc, $config); } sub get_jsonrpc_client { my ($get_mode) = @_; - require QA::RPC::JSONRPC; - my $rpc = new QA::RPC::JSONRPC(); + require Bugzilla::QA::RPC::JSONRPC; + my $rpc = new Bugzilla::QA::RPC::JSONRPC(); # If we don't set a long timeout, then the Bug.add_comment test # where we add a too-large comment fails. @@ -325,7 +327,6 @@ sub go_to_bug { my $bug_title = $sel->get_title(); utf8::encode($bug_title) if utf8::is_utf8($bug_title); $sel->title_like(qr/^$bug_id /, $bug_title); - sleep(1); # FIXME: Sometimes we try to click edit bug before it is ready so wait a second $sel->click_ok('mode-btn-readonly', 'Click Edit Bug') if !$no_edit; $sel->click_ok('action-menu-btn', 'Expand action menu'); $sel->click_ok('action-expand-all', 'Expand all modal panels'); diff --git a/t/Support/Files.pm b/Bugzilla/Test/Files.pm similarity index 98% rename from t/Support/Files.pm rename to Bugzilla/Test/Files.pm index c83d014702..678d806baf 100644 --- a/t/Support/Files.pm +++ b/Bugzilla/Test/Files.pm @@ -6,7 +6,7 @@ # defined by the Mozilla Public License, v. 2.0. -package Support::Files; +package Bugzilla::Test::Files; use 5.10.1; use strict; diff --git a/t/Support/Systemexec.pm b/Bugzilla/Test/Systemexec.pm similarity index 82% rename from t/Support/Systemexec.pm rename to Bugzilla/Test/Systemexec.pm index e73763f8f0..edd1861ac5 100644 --- a/t/Support/Systemexec.pm +++ b/Bugzilla/Test/Systemexec.pm @@ -5,14 +5,14 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -package Support::Systemexec; +package Bugzilla::Test::Systemexec; use 5.10.1; use strict; use warnings; use parent qw(Exporter); -@Support::Systemexec::EXPORT = qw(system exec); +@Bugzilla::Test::Systemexec::EXPORT = qw(system exec); sub system($$@) { 1; diff --git a/t/Support/Templates.pm b/Bugzilla/Test/Templates.pm similarity index 93% rename from t/Support/Templates.pm rename to Bugzilla/Test/Templates.pm index 8d18802fc0..b5b140b20b 100644 --- a/t/Support/Templates.pm +++ b/Bugzilla/Test/Templates.pm @@ -5,7 +5,7 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -package Support::Templates; +package Bugzilla::Test::Templates; use 5.10.1; use strict; @@ -13,14 +13,14 @@ use warnings; use lib 't'; use base qw(Exporter); -@Support::Templates::EXPORT +@Bugzilla::Test::Templates::EXPORT = qw(@languages @include_paths @english_default_include_paths %include_path @referenced_files %actual_files $num_actual_files); use Bugzilla; use Bugzilla::Constants; use Bugzilla::Install::Util qw(template_include_path); -use Support::Files; +use Bugzilla::Test::Files; use File::Find; use File::Spec; @@ -30,7 +30,7 @@ our @english_default_include_paths = (File::Spec->catdir(bz_locations()->{'templatedir'}, 'en', 'default')); # And the extensions too -foreach my $extension (@Support::Files::extensions) { +foreach my $extension (@Bugzilla::Test::Files::extensions) { my $dir = File::Spec->catdir($extension, 'template', 'en', 'default'); if (-e $dir) { push @english_default_include_paths, $dir; @@ -100,7 +100,7 @@ foreach my $include_path (@include_paths) { # in the @referenced_files array to be used by the 004template.t test. my %seen; -foreach my $file (@Support::Files::testitems) { +foreach my $file (@Bugzilla::Test::Files::testitems) { open(FILE, $file); my @lines = ; close(FILE); diff --git a/qa/config/patch.diff b/conf/patch.diff similarity index 100% rename from qa/config/patch.diff rename to conf/patch.diff diff --git a/qa/config/selenium_test.conf b/conf/selenium_test.conf similarity index 97% rename from qa/config/selenium_test.conf rename to conf/selenium_test.conf index ebdedbf7ac..a31ee645e5 100644 --- a/qa/config/selenium_test.conf +++ b/conf/selenium_test.conf @@ -14,7 +14,7 @@ { 'browser' => '*firefox', 'experimental_browser_launcher' => '*chrome', 'browser_url' => 'http://bmo.test', - 'attachment_file' => '/app/qa/config/patch.diff', + 'attachment_file' => '/app/conf/patch.diff', 'bugzilla_path' => '/app', 'test_bug_1' => 1, 'test_bug_2' => 2, diff --git a/docker-compose.test.yml b/docker-compose.test.yml index c029f6b1ae..f1eacefbd3 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -25,7 +25,7 @@ services: - BMO_urlbase=AUTOMATIC - BUGZILLA_ALLOW_INSECURE_HTTP=1 - BZ_ANSWERS_FILE=/app/conf/checksetup_answers.txt - - BZ_QA_CONF_FILE=/app/qa/config/selenium_test.conf + - BZ_QA_CONF_FILE=/app/conf/selenium_test.conf - BZ_QA_CONFIG=1 - CI=1 - LOCALCONFIG_ENV=1 diff --git a/extensions/BMO/t/bmo/bmo_etl.t b/extensions/BMO/t/bmo/bmo_etl.t index 0a7a1234f8..9c0466c55f 100644 --- a/extensions/BMO/t/bmo/bmo_etl.t +++ b/extensions/BMO/t/bmo/bmo_etl.t @@ -9,7 +9,7 @@ use 5.10.1; use strict; use warnings; -use lib qw(. lib local/lib/perl5 qa/t/lib); +use lib qw(. lib local/lib/perl5); use Bugzilla; use Bugzilla::Constants; @@ -20,9 +20,9 @@ BEGIN { use Capture::Tiny qw(capture); use DateTime; -use QA::Util qw(get_config); -use MIME::Base64 qw(encode_base64 decode_base64); -use Mojo::JSON qw(false); +use Bugzilla::QA::Util qw(get_config); +use MIME::Base64 qw(encode_base64 decode_base64); +use Mojo::JSON qw(false); use Test::Mojo; use Test::More; diff --git a/extensions/BMO/t/bmo/recorded_future.t b/extensions/BMO/t/bmo/recorded_future.t index b8e22c9735..8e1da1208c 100644 --- a/extensions/BMO/t/bmo/recorded_future.t +++ b/extensions/BMO/t/bmo/recorded_future.t @@ -8,7 +8,7 @@ use strict; use warnings; -use lib qw(. lib local/lib/perl5 qa/t/lib); +use lib qw(. lib local/lib/perl5); use Bugzilla; use Bugzilla::User; @@ -16,7 +16,7 @@ use Bugzilla::Test::Util qw(create_user); BEGIN { Bugzilla->extensions } -use QA::Util; +use Bugzilla::QA::Util; use Test::More; use Test::Mojo; use Capture::Tiny qw(capture); diff --git a/extensions/JiraWebhookSync/t/bmo/jira_webhook_sync.t b/extensions/JiraWebhookSync/t/bmo/jira_webhook_sync.t index 96750e2c46..4a2bc63ff8 100644 --- a/extensions/JiraWebhookSync/t/bmo/jira_webhook_sync.t +++ b/extensions/JiraWebhookSync/t/bmo/jira_webhook_sync.t @@ -9,13 +9,13 @@ use 5.10.1; use strict; use warnings; -use lib qw(. lib local/lib/perl5 qa/t/lib); +use lib qw(. lib local/lib/perl5); use Bugzilla; BEGIN { Bugzilla->extensions } use Mojo::Util qw(dumper); -use QA::Util; +use Bugzilla::QA::Util; use Test::More 'no_plan'; use Test::Mojo; diff --git a/external_test_api.pl b/external_test_api.pl index 1404778051..cbaac196bd 100644 --- a/external_test_api.pl +++ b/external_test_api.pl @@ -157,7 +157,7 @@ sub startup { my $request = $c->param('request'); # Load selenium config file to get the client secret, etc. - my $conf_file = '/app/qa/config/selenium_test.conf'; + my $conf_file = '/app/conf/selenium_test.conf'; my $config = do($conf_file) or die "can't read configuration '$conf_file': $!"; my $client_secret = $config->{duo_client_secret}; @@ -182,7 +182,7 @@ sub startup { my $duo_uname = $cache->{$c->param('code')}; # Load selenium config file to get the client secret, etc. - my $conf_file = '/app/qa/config/selenium_test.conf'; + my $conf_file = '/app/conf/selenium_test.conf'; my $config = do($conf_file) or die "can't read configuration '$conf_file': $!"; my $client_secret = $config->{duo_client_secret}; diff --git a/qa/t/1_test_attention.t b/qa/t/1_test_attention.t index f1048eb463..766d3c8ab4 100644 --- a/qa/t/1_test_attention.t +++ b/qa/t/1_test_attention.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More 'no_plan'; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/1_test_bmo_autolinkification.t b/qa/t/1_test_bmo_autolinkification.t index b4308647fc..f5ae2a7ab4 100644 --- a/qa/t/1_test_bmo_autolinkification.t +++ b/qa/t/1_test_bmo_autolinkification.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/1_test_bmo_enter_new_bug.t b/qa/t/1_test_bmo_enter_new_bug.t index 734bb4848f..215a05f3a1 100644 --- a/qa/t/1_test_bmo_enter_new_bug.t +++ b/qa/t/1_test_bmo_enter_new_bug.t @@ -14,11 +14,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/1_test_bmo_retire_values.t b/qa/t/1_test_bmo_retire_values.t index 524ea47558..055e8011b4 100644 --- a/qa/t/1_test_bmo_retire_values.t +++ b/qa/t/1_test_bmo_retire_values.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); my ($text, $bug_id); diff --git a/qa/t/1_test_bug_edit.t b/qa/t/1_test_bug_edit.t index 2fd84eb0f1..bec1ad4026 100644 --- a/qa/t/1_test_bug_edit.t +++ b/qa/t/1_test_bug_edit.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/1_test_choose_priority.t b/qa/t/1_test_choose_priority.t index 6320df6523..7e342bc42e 100644 --- a/qa/t/1_test_choose_priority.t +++ b/qa/t/1_test_choose_priority.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/1_test_classifications.t b/qa/t/1_test_classifications.t index 0275d3f805..5bfd169806 100644 --- a/qa/t/1_test_classifications.t +++ b/qa/t/1_test_classifications.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/1_test_config.t b/qa/t/1_test_config.t index cd9f23fa6a..7359387dfd 100644 --- a/qa/t/1_test_config.t +++ b/qa/t/1_test_config.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/1_test_cookie_consent.t b/qa/t/1_test_cookie_consent.t index e66de42822..11b8f74218 100644 --- a/qa/t/1_test_cookie_consent.t +++ b/qa/t/1_test_cookie_consent.t @@ -7,12 +7,12 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More 'no_plan'; use List::Util qw(first none); -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/1_test_create_user_accounts.t b/qa/t/1_test_create_user_accounts.t index 06e0d50c92..e43c1165e9 100644 --- a/qa/t/1_test_create_user_accounts.t +++ b/qa/t/1_test_create_user_accounts.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/1_test_custom_fields.t b/qa/t/1_test_custom_fields.t index 9cfc43a88e..d25c368b9c 100644 --- a/qa/t/1_test_custom_fields.t +++ b/qa/t/1_test_custom_fields.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); log_in($sel, $config, 'admin'); diff --git a/qa/t/1_test_custom_fields_admin.t b/qa/t/1_test_custom_fields_admin.t index b095bdbccc..84eb04782c 100644 --- a/qa/t/1_test_custom_fields_admin.t +++ b/qa/t/1_test_custom_fields_admin.t @@ -7,13 +7,13 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Bugzilla::RNG; use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); log_in($sel, $config, 'admin'); diff --git a/qa/t/1_test_duo_requirement.t b/qa/t/1_test_duo_requirement.t index 93c8ce0fd0..80e020a0de 100644 --- a/qa/t/1_test_duo_requirement.t +++ b/qa/t/1_test_duo_requirement.t @@ -7,10 +7,10 @@ use strict; use warnings; -use lib qw(lib ../.. ../../local/lib/perl5); +use lib qw(. lib); use Bugzilla; -use QA::Util; +use Bugzilla::QA::Util; use Test::Mojo; use Test::More 'no_plan'; diff --git a/qa/t/2_test_default_groups.t b/qa/t/2_test_default_groups.t index 8713ee577c..572d3fef3d 100644 --- a/qa/t/2_test_default_groups.t +++ b/qa/t/2_test_default_groups.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/2_test_dependencies.t b/qa/t/2_test_dependencies.t index 3b208d5615..8d270c4be5 100644 --- a/qa/t/2_test_dependencies.t +++ b/qa/t/2_test_dependencies.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/2_test_edit_products_properties.t b/qa/t/2_test_edit_products_properties.t index ea64601c1a..87005e4ed6 100644 --- a/qa/t/2_test_edit_products_properties.t +++ b/qa/t/2_test_edit_products_properties.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/2_test_enter_new_bug.t b/qa/t/2_test_enter_new_bug.t index 0c67f65c9b..bb0a267bcf 100644 --- a/qa/t/2_test_enter_new_bug.t +++ b/qa/t/2_test_enter_new_bug.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/2_test_flags.t b/qa/t/2_test_flags.t index 8938ddbb2a..94c8c86206 100644 --- a/qa/t/2_test_flags.t +++ b/qa/t/2_test_flags.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; # We have to upload files from the local computer. This requires # chrome privileges. diff --git a/qa/t/2_test_flags2.t b/qa/t/2_test_flags2.t index cd993ecb7b..aea521ccab 100644 --- a/qa/t/2_test_flags2.t +++ b/qa/t/2_test_flags2.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; ################################################################ # 2nd script about flags. This one is focused on flag behavior # diff --git a/qa/t/2_test_groups.t b/qa/t/2_test_groups.t index 9a92903b4b..96a853b247 100644 --- a/qa/t/2_test_groups.t +++ b/qa/t/2_test_groups.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/2_test_keywords.t b/qa/t/2_test_keywords.t index 4349f342ad..697dfbaf4e 100644 --- a/qa/t/2_test_keywords.t +++ b/qa/t/2_test_keywords.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/2_test_lockout.t b/qa/t/2_test_lockout.t index cb5c2ec75c..9f34c516c3 100644 --- a/qa/t/2_test_lockout.t +++ b/qa/t/2_test_lockout.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More 'no_plan'; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/2_test_login.t b/qa/t/2_test_login.t index 73b2b71554..e1e976ef4e 100644 --- a/qa/t/2_test_login.t +++ b/qa/t/2_test_login.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/2_test_login_duo.t b/qa/t/2_test_login_duo.t index f991b54b8a..042e153156 100644 --- a/qa/t/2_test_login_duo.t +++ b/qa/t/2_test_login_duo.t @@ -7,9 +7,9 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); -use QA::Util; +use Bugzilla::QA::Util; use Test::More; my ($sel, $config) = get_selenium(); diff --git a/qa/t/2_test_login_totp.t b/qa/t/2_test_login_totp.t index 4af3a681b9..a6524741df 100644 --- a/qa/t/2_test_login_totp.t +++ b/qa/t/2_test_login_totp.t @@ -7,7 +7,7 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Bugzilla; use Bugzilla::Util qw(template_var); @@ -15,7 +15,7 @@ use Bugzilla::Util qw(template_var); use Auth::GoogleAuth; use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/2_test_milestones.t b/qa/t/2_test_milestones.t index 7a8b926ed9..f0d5e3b91a 100644 --- a/qa/t/2_test_milestones.t +++ b/qa/t/2_test_milestones.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/3_test_component_graveyard.t b/qa/t/3_test_component_graveyard.t index e2125805c4..972ea689ac 100644 --- a/qa/t/3_test_component_graveyard.t +++ b/qa/t/3_test_component_graveyard.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More 'no_plan'; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/3_test_net_attachments.t b/qa/t/3_test_net_attachments.t index 933d76c8bb..a108da639c 100644 --- a/qa/t/3_test_net_attachments.t +++ b/qa/t/3_test_net_attachments.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; # We have to upload files from the local computer. This requires # chrome privileges. diff --git a/qa/t/3_test_new_release.t b/qa/t/3_test_new_release.t index 3e506e131d..8edc73ff37 100644 --- a/qa/t/3_test_new_release.t +++ b/qa/t/3_test_new_release.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/3_test_private_attachments.t b/qa/t/3_test_private_attachments.t index f2fb19b18e..d28976394b 100644 --- a/qa/t/3_test_private_attachments.t +++ b/qa/t/3_test_private_attachments.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; # We have to upload files from the local computer. This requires # chrome privileges. diff --git a/qa/t/3_test_qa_contact.t b/qa/t/3_test_qa_contact.t index 5b0456da00..02dfc745cb 100644 --- a/qa/t/3_test_qa_contact.t +++ b/qa/t/3_test_qa_contact.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/3_test_rate_limit.t b/qa/t/3_test_rate_limit.t index 7be26c5f42..a67f0de0a0 100644 --- a/qa/t/3_test_rate_limit.t +++ b/qa/t/3_test_rate_limit.t @@ -7,10 +7,10 @@ use strict; use warnings; -use lib qw(lib ../.. ../../local/lib/perl5); +use lib qw(. lib); use Cache::Memcached::Fast; -use QA::Util; +use Bugzilla::QA::Util; use Test::Mojo; use Test::More "no_plan"; diff --git a/qa/t/3_test_reminders.t b/qa/t/3_test_reminders.t index b6014c7186..3bd2539ff1 100644 --- a/qa/t/3_test_reminders.t +++ b/qa/t/3_test_reminders.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More 'no_plan'; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/3_test_require_login.t b/qa/t/3_test_require_login.t index d46ae45f00..85bfb234f5 100644 --- a/qa/t/3_test_require_login.t +++ b/qa/t/3_test_require_login.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/3_test_sanity_check.t b/qa/t/3_test_sanity_check.t index 22d02ab7e2..735411b080 100644 --- a/qa/t/3_test_sanity_check.t +++ b/qa/t/3_test_sanity_check.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/3_test_saved_searches.t b/qa/t/3_test_saved_searches.t index 17ec15ef05..5d5ffb1f2d 100644 --- a/qa/t/3_test_saved_searches.t +++ b/qa/t/3_test_saved_searches.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/3_test_search.t b/qa/t/3_test_search.t index 1b3fcad36c..9e8b21fd66 100644 --- a/qa/t/3_test_search.t +++ b/qa/t/3_test_search.t @@ -7,8 +7,8 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); -use QA::Util; +use lib qw(. lib); +use Bugzilla::QA::Util; use Test::More "no_plan"; my ($sel, $config) = get_selenium(); diff --git a/qa/t/3_test_security.t b/qa/t/3_test_security.t index 3ba4f17938..a86faa2c31 100644 --- a/qa/t/3_test_security.t +++ b/qa/t/3_test_security.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(CHROME_MODE); my $admin_user = $config->{admin_user_login}; diff --git a/qa/t/3_test_see_also.t b/qa/t/3_test_see_also.t index 0afa32f80f..cd102e1302 100644 --- a/qa/t/3_test_see_also.t +++ b/qa/t/3_test_see_also.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/4_test_shared_searches.t b/qa/t/4_test_shared_searches.t index ed1d39b4b9..e6813c20a0 100644 --- a/qa/t/4_test_shared_searches.t +++ b/qa/t/4_test_shared_searches.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/4_test_show_all_products.t b/qa/t/4_test_show_all_products.t index 7967af1a56..7017440bc3 100644 --- a/qa/t/4_test_show_all_products.t +++ b/qa/t/4_test_show_all_products.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/4_test_status_whiteboard.t b/qa/t/4_test_status_whiteboard.t index 56edd3e7ef..49cab29e08 100644 --- a/qa/t/4_test_status_whiteboard.t +++ b/qa/t/4_test_status_whiteboard.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/4_test_sudo_sessions.t b/qa/t/4_test_sudo_sessions.t index 04388e3f52..6123f4c3e2 100644 --- a/qa/t/4_test_sudo_sessions.t +++ b/qa/t/4_test_sudo_sessions.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/4_test_target_milestones.t b/qa/t/4_test_target_milestones.t index 408a2e705f..8bccaa03b0 100644 --- a/qa/t/4_test_target_milestones.t +++ b/qa/t/4_test_target_milestones.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/4_test_time_summary.t b/qa/t/4_test_time_summary.t index db03475c96..027ac3ef91 100644 --- a/qa/t/4_test_time_summary.t +++ b/qa/t/4_test_time_summary.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/4_test_user_groups.t b/qa/t/4_test_user_groups.t index c281b1e5d0..df9f5060da 100644 --- a/qa/t/4_test_user_groups.t +++ b/qa/t/4_test_user_groups.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; use constant PASSWORD => 'uChoopoh1che'; my ($sel, $config) = get_selenium(); diff --git a/qa/t/4_test_user_matching.t b/qa/t/4_test_user_matching.t index 7b2e3c7518..9c1c85d0a5 100644 --- a/qa/t/4_test_user_matching.t +++ b/qa/t/4_test_user_matching.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/4_test_user_preferences.t b/qa/t/4_test_user_preferences.t index 2f848746a1..047f92ab23 100644 --- a/qa/t/4_test_user_preferences.t +++ b/qa/t/4_test_user_preferences.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/4_test_user_privs.t b/qa/t/4_test_user_privs.t index 646e60bbc8..f00d2c6646 100644 --- a/qa/t/4_test_user_privs.t +++ b/qa/t/4_test_user_privs.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); my $test_bug_1 = $config->{test_bug_1}; diff --git a/qa/t/4_test_votes.t b/qa/t/4_test_votes.t index f51a51080d..14628b3037 100644 --- a/qa/t/4_test_votes.t +++ b/qa/t/4_test_votes.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/4_test_webhooks.t b/qa/t/4_test_webhooks.t index d60741baf0..9b91618094 100644 --- a/qa/t/4_test_webhooks.t +++ b/qa/t/4_test_webhooks.t @@ -7,12 +7,12 @@ use strict; use warnings; -use lib qw(lib ../.. ../../local/lib/perl5); +use lib qw(. lib); use Bugzilla; BEGIN { Bugzilla->extensions } -use QA::Util; +use Bugzilla::QA::Util; use Test::More "no_plan"; use Test::Mojo; diff --git a/qa/t/archived/test_email_preferences.t b/qa/t/archived/test_email_preferences.t index 57f4194951..c82431fdec 100644 --- a/qa/t/archived/test_email_preferences.t +++ b/qa/t/archived/test_email_preferences.t @@ -11,7 +11,7 @@ use lib qw(lib); use Test::More "no_plan"; -use QA::Util; +use Bugzilla::QA::Util; my ($sel, $config) = get_selenium(); diff --git a/qa/t/rest_bug.t b/qa/t/rest_bug.t index 405738d216..7b80a2a6ab 100644 --- a/qa/t/rest_bug.t +++ b/qa/t/rest_bug.t @@ -8,11 +8,11 @@ use strict; use warnings; use 5.10.1; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Bugzilla; use Bugzilla::Util qw(generate_random_password); -use QA::Util qw(get_config); +use Bugzilla::QA::Util qw(get_config); use MIME::Base64 qw(encode_base64 decode_base64); use Test::Mojo; diff --git a/qa/t/rest_bugzilla.t b/qa/t/rest_bugzilla.t index e921a7466a..131c22a58c 100644 --- a/qa/t/rest_bugzilla.t +++ b/qa/t/rest_bugzilla.t @@ -8,11 +8,11 @@ use 5.10.1; use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Bugzilla; use Bugzilla::Constants; -use QA::Util qw(get_config); +use Bugzilla::QA::Util qw(get_config); use Test::Mojo; use Test::More; diff --git a/qa/t/rest_classification.t b/qa/t/rest_classification.t index fd53a65a5d..72487f9d5a 100644 --- a/qa/t/rest_classification.t +++ b/qa/t/rest_classification.t @@ -12,11 +12,11 @@ use 5.10.1; use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Bugzilla; use Bugzilla::Constants; -use QA::Util qw(get_config); +use Bugzilla::QA::Util qw(get_config); use Test::Mojo; use Test::More; diff --git a/qa/t/rest_components.t b/qa/t/rest_components.t index a8b1c2cf08..d7afa2f338 100644 --- a/qa/t/rest_components.t +++ b/qa/t/rest_components.t @@ -8,10 +8,10 @@ use strict; use warnings; use 5.10.1; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Bugzilla; -use QA::Util qw(get_config); +use Bugzilla::QA::Util qw(get_config); use MIME::Base64 qw(encode_base64 decode_base64); use Test::Mojo; diff --git a/qa/t/rest_github_pull_request.t b/qa/t/rest_github_pull_request.t index 2258d01c25..2290eab0c4 100644 --- a/qa/t/rest_github_pull_request.t +++ b/qa/t/rest_github_pull_request.t @@ -8,14 +8,14 @@ use strict; use warnings; use 5.10.1; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Bugzilla; use Bugzilla::Logging; use MIME::Base64 qw(decode_base64); use Mojo::JSON 'true'; -use QA::Util qw(get_config generate_payload_signature); +use Bugzilla::QA::Util qw(get_config generate_payload_signature); use Test::Mojo; use Test::More; diff --git a/qa/t/rest_github_push_comment.t b/qa/t/rest_github_push_comment.t index 0e30fd4ceb..2d67c94f82 100644 --- a/qa/t/rest_github_push_comment.t +++ b/qa/t/rest_github_push_comment.t @@ -8,12 +8,12 @@ use strict; use warnings; use 5.10.1; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Bugzilla; use Mojo::JSON qw(encode_json false); -use QA::Util qw(get_config generate_payload_signature); +use Bugzilla::QA::Util qw(get_config generate_payload_signature); use Test::Mojo; use Test::More; diff --git a/qa/t/rest_group_get.t b/qa/t/rest_group_get.t index fa44931aa4..cef7c696a0 100644 --- a/qa/t/rest_group_get.t +++ b/qa/t/rest_group_get.t @@ -8,10 +8,10 @@ use strict; use warnings; use 5.10.1; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Bugzilla; -use QA::Util qw(get_config); +use Bugzilla::QA::Util qw(get_config); use Mojo::JSON qw(true); use Mojo::Util qw(dumper); diff --git a/qa/t/rest_lando_uplift.t b/qa/t/rest_lando_uplift.t index 64d8c2aa4d..a63468b1bd 100644 --- a/qa/t/rest_lando_uplift.t +++ b/qa/t/rest_lando_uplift.t @@ -8,10 +8,10 @@ use strict; use warnings; use 5.10.1; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Bugzilla; -use QA::Util qw(get_config); +use Bugzilla::QA::Util qw(get_config); use Test::Mojo; use Test::More; diff --git a/qa/t/rest_last_change_time_non_bot.t b/qa/t/rest_last_change_time_non_bot.t index e85c4a3b61..229cc7b633 100644 --- a/qa/t/rest_last_change_time_non_bot.t +++ b/qa/t/rest_last_change_time_non_bot.t @@ -8,10 +8,10 @@ use strict; use warnings; use 5.10.1; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Bugzilla; -use QA::Util qw(get_config); +use Bugzilla::QA::Util qw(get_config); use Test::Mojo; use Test::More; diff --git a/qa/t/rest_pulsebot.t b/qa/t/rest_pulsebot.t index 8c152df82e..40ffa00ace 100644 --- a/qa/t/rest_pulsebot.t +++ b/qa/t/rest_pulsebot.t @@ -8,10 +8,10 @@ use strict; use warnings; use 5.10.1; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Bugzilla; -use QA::Util qw(get_config); +use Bugzilla::QA::Util qw(get_config); use Test::Mojo; use Test::More; diff --git a/qa/t/rest_relationship_trees.t b/qa/t/rest_relationship_trees.t index 0c79990309..02581e12ce 100644 --- a/qa/t/rest_relationship_trees.t +++ b/qa/t/rest_relationship_trees.t @@ -8,11 +8,11 @@ use strict; use warnings; use 5.10.1; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Bugzilla; -use QA::Util qw(get_config); -use QA::Tests qw(create_bug_fields PRIVATE_BUG_USER); +use Bugzilla::QA::Util qw(get_config); +use Bugzilla::QA::Tests qw(create_bug_fields PRIVATE_BUG_USER); use Test::Mojo; use Test::More; diff --git a/qa/t/rest_reminders.t b/qa/t/rest_reminders.t index 8d39d155a4..71c6f9090a 100644 --- a/qa/t/rest_reminders.t +++ b/qa/t/rest_reminders.t @@ -8,10 +8,10 @@ use strict; use warnings; use 5.10.1; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Bugzilla; -use QA::Util qw(get_config); +use Bugzilla::QA::Util qw(get_config); use Test::Mojo; use Test::More; diff --git a/qa/t/rest_search_api.t b/qa/t/rest_search_api.t index c0bdbd063b..18658ea3b7 100644 --- a/qa/t/rest_search_api.t +++ b/qa/t/rest_search_api.t @@ -8,12 +8,12 @@ use strict; use warnings; use 5.10.1; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Bugzilla; use Bugzilla::User; -use QA::Util qw(get_config); +use Bugzilla::QA::Util qw(get_config); use Test::Mojo; use Test::More; diff --git a/qa/t/rest_see_also.t b/qa/t/rest_see_also.t index af4fe78df2..84a74da347 100644 --- a/qa/t/rest_see_also.t +++ b/qa/t/rest_see_also.t @@ -8,11 +8,11 @@ use strict; use warnings; use 5.10.1; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Bugzilla; -use QA::Util qw(get_config); -use QA::Tests qw(create_bug_fields PRIVATE_BUG_USER); +use Bugzilla::QA::Util qw(get_config); +use Bugzilla::QA::Tests qw(create_bug_fields PRIVATE_BUG_USER); use Test::Mojo; use Test::More; diff --git a/qa/t/rest_triage_owners.t b/qa/t/rest_triage_owners.t index 3545b59547..3172209932 100644 --- a/qa/t/rest_triage_owners.t +++ b/qa/t/rest_triage_owners.t @@ -8,10 +8,10 @@ use strict; use warnings; use 5.10.1; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Bugzilla; -use QA::Util qw(get_config); +use Bugzilla::QA::Util qw(get_config); use Test::Mojo; use Test::More; diff --git a/qa/t/webservice_bug_add_attachment.t b/qa/t/webservice_bug_add_attachment.t index 8b4759c424..96617aab0a 100644 --- a/qa/t/webservice_bug_add_attachment.t +++ b/qa/t/webservice_bug_add_attachment.t @@ -7,8 +7,8 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); -use QA::Util; +use lib qw(. lib); +use Bugzilla::QA::Util; use MIME::Base64 qw(encode_base64 decode_base64); use Test::More tests => 187; my ($config, $xmlrpc, $jsonrpc, $jsonrpc_get) = get_rpc_clients(); @@ -213,7 +213,7 @@ foreach my $rpc ($jsonrpc, $xmlrpc) { # We have to encode data manually when using JSON-RPC, else it fails. sub pre_call { my ($t, $rpc) = @_; - return if !$rpc->isa('QA::RPC::JSONRPC'); + return if !$rpc->isa('Bugzilla::QA::RPC::JSONRPC'); return if !defined $t->{args}->{data}; $t->{args}->{data} = encode_base64($t->{args}->{data}, ''); @@ -247,7 +247,7 @@ sub post_success { ); } - if ($rpc->isa('QA::RPC::JSONRPC')) { + if ($rpc->isa('Bugzilla::QA::RPC::JSONRPC')) { # We encoded data in pre_call(), so we have to restore it to its original content. $t->{args}->{data} = decode_base64($t->{args}->{data}); diff --git a/qa/t/webservice_bug_add_comment.t b/qa/t/webservice_bug_add_comment.t index a7b95caeba..4a20c1e299 100644 --- a/qa/t/webservice_bug_add_comment.t +++ b/qa/t/webservice_bug_add_comment.t @@ -11,8 +11,8 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); -use QA::Util; +use lib qw(. lib); +use Bugzilla::QA::Util; use Test::More tests => 141; my ($config, $xmlrpc, $jsonrpc, $jsonrpc_get) = get_rpc_clients(); diff --git a/qa/t/webservice_bug_attachments.t b/qa/t/webservice_bug_attachments.t index cd2e6bfa4a..c146b383d3 100644 --- a/qa/t/webservice_bug_attachments.t +++ b/qa/t/webservice_bug_attachments.t @@ -7,9 +7,9 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); -use QA::Util; -use QA::Tests qw(STANDARD_BUG_TESTS PRIVATE_BUG_USER); +use lib qw(. lib); +use Bugzilla::QA::Util; +use Bugzilla::QA::Tests qw(STANDARD_BUG_TESTS PRIVATE_BUG_USER); use Data::Dumper; use List::Util qw(first); use MIME::Base64; @@ -64,7 +64,7 @@ foreach my $alias (qw(public_bug private_bug)) { # Attachment Tests # #################### -my $content_file = '../config/generate_test_data.pl'; +my $content_file = 'scripts/generate_test_data.pl'; open(my $fh, '<', $content_file) or die "$content_file: $!"; my $content; { local $/; $content = <$fh>; } @@ -158,7 +158,7 @@ sub post_success { "creator is the correct user" ); my $data = $attachment->{data}; - $data = decode_base64($data) if $rpc->isa('QA::RPC::JSONRPC'); + $data = decode_base64($data) if $rpc->isa('Bugzilla::QA::RPC::JSONRPC'); is($data, $content, 'data is correct'); is($attachment->{size}, length($data), "size matches data's size"); } diff --git a/qa/t/webservice_bug_comments.t b/qa/t/webservice_bug_comments.t index f3f834f851..285d47f78d 100644 --- a/qa/t/webservice_bug_comments.t +++ b/qa/t/webservice_bug_comments.t @@ -11,10 +11,10 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use DateTime; -use QA::Util; -use QA::Tests qw(STANDARD_BUG_TESTS PRIVATE_BUG_USER); +use Bugzilla::QA::Util; +use Bugzilla::QA::Tests qw(STANDARD_BUG_TESTS PRIVATE_BUG_USER); use Test::More tests => 331; my ($config, @clients) = get_rpc_clients(); @@ -48,7 +48,7 @@ sub test_comments { my $creation_day; - if ($rpc->isa('QA::RPC::XMLRPC')) { + if ($rpc->isa('Bugzilla::QA::RPC::XMLRPC')) { $creation_day = $creation_time->ymd(''); } else { diff --git a/qa/t/webservice_bug_create.t b/qa/t/webservice_bug_create.t index 4aa5ae1750..2a07fe7acf 100644 --- a/qa/t/webservice_bug_create.t +++ b/qa/t/webservice_bug_create.t @@ -11,11 +11,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Storable qw(dclone); use Test::More tests => 305; -use QA::Util; -use QA::Tests qw(create_bug_fields PRIVATE_BUG_USER); +use Bugzilla::QA::Util; +use Bugzilla::QA::Tests qw(create_bug_fields PRIVATE_BUG_USER); my ($config, $xmlrpc, $jsonrpc, $jsonrpc_get) = get_rpc_clients(); diff --git a/qa/t/webservice_bug_fields.t b/qa/t/webservice_bug_fields.t index 8add62c555..15bf16fde9 100644 --- a/qa/t/webservice_bug_fields.t +++ b/qa/t/webservice_bug_fields.t @@ -7,11 +7,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Data::Dumper; use Test::More; use List::Util qw(first); -use QA::Util; +use Bugzilla::QA::Util; my ($config, @clients) = get_rpc_clients(); plan tests => ($config->{test_extensions} ? 1416 : 1398); diff --git a/qa/t/webservice_bug_get.t b/qa/t/webservice_bug_get.t index 2c7d4893e5..871fff56d6 100644 --- a/qa/t/webservice_bug_get.t +++ b/qa/t/webservice_bug_get.t @@ -11,11 +11,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Data::Dumper; use DateTime; -use QA::Util; -use QA::Tests qw(bug_tests PRIVATE_BUG_USER); +use Bugzilla::QA::Util; +use Bugzilla::QA::Tests qw(bug_tests PRIVATE_BUG_USER); use Test::More tests => 1087; my ($config, @clients) = get_rpc_clients(); diff --git a/qa/t/webservice_bug_get_bugs.t b/qa/t/webservice_bug_get_bugs.t index 48b423bd76..4ee050e11e 100644 --- a/qa/t/webservice_bug_get_bugs.t +++ b/qa/t/webservice_bug_get_bugs.t @@ -11,11 +11,11 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Data::Dumper; use DateTime; -use QA::Util; -use QA::Tests qw(bug_tests PRIVATE_BUG_USER); +use Bugzilla::QA::Util; +use Bugzilla::QA::Tests qw(bug_tests PRIVATE_BUG_USER); use Test::More tests => 979; my ($config, @clients) = get_rpc_clients(); diff --git a/qa/t/webservice_bug_history.t b/qa/t/webservice_bug_history.t index 7accacfd6f..6f3cab1814 100644 --- a/qa/t/webservice_bug_history.t +++ b/qa/t/webservice_bug_history.t @@ -11,9 +11,9 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); -use QA::Util; -use QA::Tests qw(STANDARD_BUG_TESTS); +use lib qw(. lib); +use Bugzilla::QA::Util; +use Bugzilla::QA::Tests qw(STANDARD_BUG_TESTS); use Test::More tests => 114; my ($config, @clients) = get_rpc_clients(); diff --git a/qa/t/webservice_bug_legal_values.t b/qa/t/webservice_bug_legal_values.t index 979db7068d..4dcaf46333 100644 --- a/qa/t/webservice_bug_legal_values.t +++ b/qa/t/webservice_bug_legal_values.t @@ -11,9 +11,9 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More tests => 275; -use QA::Util; +use Bugzilla::QA::Util; my ($config, @clients) = get_rpc_clients(); use constant INVALID_PRODUCT_ID => -1; diff --git a/qa/t/webservice_bug_search.t b/qa/t/webservice_bug_search.t index c873c74e7c..2990a374da 100644 --- a/qa/t/webservice_bug_search.t +++ b/qa/t/webservice_bug_search.t @@ -11,9 +11,9 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); -use QA::Util; -use QA::Tests qw(PRIVATE_BUG_USER); +use lib qw(. lib); +use Bugzilla::QA::Util; +use Bugzilla::QA::Tests qw(PRIVATE_BUG_USER); use DateTime; use List::MoreUtils qw(uniq); use Test::More; diff --git a/qa/t/webservice_bug_update.t b/qa/t/webservice_bug_update.t index 9a26887437..f32e33c163 100644 --- a/qa/t/webservice_bug_update.t +++ b/qa/t/webservice_bug_update.t @@ -7,10 +7,10 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Data::Dumper; -use QA::Util; -use QA::Tests qw(PRIVATE_BUG_USER STANDARD_BUG_TESTS); +use Bugzilla::QA::Util; +use Bugzilla::QA::Tests qw(PRIVATE_BUG_USER STANDARD_BUG_TESTS); use Storable qw(dclone); use Test::More tests => 923; diff --git a/qa/t/webservice_bug_update_see_also.t b/qa/t/webservice_bug_update_see_also.t index 9fd1613e8c..aff327b37e 100644 --- a/qa/t/webservice_bug_update_see_also.t +++ b/qa/t/webservice_bug_update_see_also.t @@ -11,9 +11,9 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); -use QA::Util; -use QA::Tests qw(PRIVATE_BUG_USER STANDARD_BUG_TESTS); +use lib qw(. lib); +use Bugzilla::QA::Util; +use Bugzilla::QA::Tests qw(PRIVATE_BUG_USER STANDARD_BUG_TESTS); use Test::More tests => 117; my ($config, $xmlrpc, $jsonrpc, $jsonrpc_get) = get_rpc_clients(); diff --git a/qa/t/webservice_bugzilla.t b/qa/t/webservice_bugzilla.t index 5ed6e5f9a6..6662b8aefb 100644 --- a/qa/t/webservice_bugzilla.t +++ b/qa/t/webservice_bugzilla.t @@ -11,9 +11,9 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More tests => 33; -use QA::Util; +use Bugzilla::QA::Util; my ($config, @clients) = get_rpc_clients(); foreach my $rpc (@clients) { diff --git a/qa/t/webservice_group_create.t b/qa/t/webservice_group_create.t index 8622621a13..4e1e1a2974 100644 --- a/qa/t/webservice_group_create.t +++ b/qa/t/webservice_group_create.t @@ -11,9 +11,9 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More tests => 77; -use QA::Util; +use Bugzilla::QA::Util; use constant DESCRIPTION => 'Group created by Group.create'; diff --git a/qa/t/webservice_jsonp.t b/qa/t/webservice_jsonp.t index 8aa72a145f..f045706cf9 100644 --- a/qa/t/webservice_jsonp.t +++ b/qa/t/webservice_jsonp.t @@ -7,10 +7,10 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More tests => 85; -use QA::Util; -my $jsonrpc_get = QA::Util::get_jsonrpc_client('GET'); +use Bugzilla::QA::Util; +my $jsonrpc_get = Bugzilla::QA::Util::get_jsonrpc_client('GET'); my @chars = (0 .. 9, 'A' .. 'Z', 'a' .. 'z', '_[].'); diff --git a/qa/t/webservice_product.t b/qa/t/webservice_product.t index 7d44f08ae1..a09a389883 100644 --- a/qa/t/webservice_product.t +++ b/qa/t/webservice_product.t @@ -15,9 +15,9 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More tests => 134; -use QA::Util; +use Bugzilla::QA::Util; my ($config, @clients) = get_rpc_clients(); my $products = $clients[0]->bz_get_products(); diff --git a/qa/t/webservice_product_create.t b/qa/t/webservice_product_create.t index 19f74b9f8c..5a33c34cc7 100644 --- a/qa/t/webservice_product_create.t +++ b/qa/t/webservice_product_create.t @@ -11,9 +11,9 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More tests => 109; -use QA::Util; +use Bugzilla::QA::Util; use constant DESCRIPTION => 'Product created by Product.create'; use constant PROD_VERSION => 'unspecified'; diff --git a/qa/t/webservice_product_get.t b/qa/t/webservice_product_get.t index bd46ae4005..1912d82f50 100644 --- a/qa/t/webservice_product_get.t +++ b/qa/t/webservice_product_get.t @@ -15,9 +15,9 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Test::More tests => 134; -use QA::Util; +use Bugzilla::QA::Util; my ($config, @clients) = get_rpc_clients(); my $products = $clients[0]->bz_get_products(); diff --git a/qa/t/webservice_user_create.t b/qa/t/webservice_user_create.t index a67aa259d5..5b92eaca19 100644 --- a/qa/t/webservice_user_create.t +++ b/qa/t/webservice_user_create.t @@ -11,8 +11,8 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); -use QA::Util; +use lib qw(. lib); +use Bugzilla::QA::Util; use Test::More tests => 83; my ($config, $xmlrpc, $jsonrpc, $jsonrpc_get) = get_rpc_clients(); diff --git a/qa/t/webservice_user_get.t b/qa/t/webservice_user_get.t index c84b859208..a8662eb92e 100644 --- a/qa/t/webservice_user_get.t +++ b/qa/t/webservice_user_get.t @@ -11,9 +11,9 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); -use QA::Util; -use QA::Tests qw(PRIVATE_BUG_USER); +use lib qw(. lib); +use Bugzilla::QA::Util; +use Bugzilla::QA::Tests qw(PRIVATE_BUG_USER); use Test::More tests => 330; our ($config, @clients) = get_rpc_clients(); diff --git a/qa/t/webservice_user_login_logout.t b/qa/t/webservice_user_login_logout.t index 8c86ac0e8d..52d50aa5f6 100644 --- a/qa/t/webservice_user_login_logout.t +++ b/qa/t/webservice_user_login_logout.t @@ -11,9 +11,9 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); +use lib qw(. lib); use Data::Dumper; -use QA::Util; +use Bugzilla::QA::Util; use Test::More tests => 119; my ($config, @clients) = get_rpc_clients(); diff --git a/qa/t/webservice_user_offer_account_by_email.t b/qa/t/webservice_user_offer_account_by_email.t index 10b5714b20..fff7565205 100644 --- a/qa/t/webservice_user_offer_account_by_email.t +++ b/qa/t/webservice_user_offer_account_by_email.t @@ -11,8 +11,8 @@ use strict; use warnings; -use lib qw(lib ../../lib ../../local/lib/perl5); -use QA::Util; +use lib qw(. lib); +use Bugzilla::QA::Util; use Test::More tests => 29; my ($config, $xmlrpc, $jsonrpc, $jsonrpc_get) = get_rpc_clients(); diff --git a/scripts/entrypoint.pl b/scripts/entrypoint.pl index e0d2d17c09..9c4a0e6928 100755 --- a/scripts/entrypoint.pl +++ b/scripts/entrypoint.pl @@ -132,11 +132,7 @@ sub cmd_load_test_data { '--param', 'use_mailer_queue=0' ); - if ($ENV{BZ_QA_CONFIG}) { - chdir '/app/qa/config'; - run_quiet('perl', 'generate_test_data.pl'); - chdir '/app'; - } + run_quiet('perl', 'scripts/generate_test_data.pl') if $ENV{BZ_QA_CONFIG}; } sub cmd_push_data { @@ -144,39 +140,32 @@ sub cmd_push_data { } sub cmd_test_sanity { - my @tests = @_; - run('prove', '-I/app', '-I/app/local/lib/perl5', '-qf', @tests); + my @args = @_; + run('prove', '-I/app', '-I/app/local/lib/perl5', @args); } sub cmd_test_webservices { - cmd_test_qa('{webservice,rest}_*.t'); + cmd_test_qa(@_); } sub cmd_test_selenium { - my $file_pattern = '*test_*.t'; - if ($ENV{SELENIUM_GROUP}) { - $file_pattern = $ENV{SELENIUM_GROUP} . '_test_*.t'; - } - cmd_test_qa($file_pattern); + cmd_test_qa(@_); } sub cmd_test_qa { - my $test_files = shift; + my (@args) = @_; $ENV{HTTP_BACKEND} = 'simple'; $ENV{MOJO_MODE} = 'production'; cmd_load_test_data(); check_data_dir(); - mkdir '/app/artifacts' if !-d '/app/artifacts'; assert_database()->get; my $httpd_exit_f = run_cereal_and_httpd('-DHTTPD_IN_SUBDIR', '-DACCESS_LOGS'); my $prove_exit_f = run_prove( prove_cmd => [ - 'prove', '-qf', '-I/app', '-I/app/local/lib/perl5', - sub { glob $test_files }, + 'prove', '-I/app', '-I/app/local/lib/perl5', @args ], - prove_dir => '/app/qa/t', ); exit Future->wait_any($prove_exit_f, $httpd_exit_f)->get; } @@ -189,7 +178,7 @@ sub cmd_prove { } sub cmd_test_bmo { - my (@prove_args) = @_; + my (@args) = @_; $ENV{HTTP_BACKEND} = 'hypnotoad'; cmd_load_test_data(); @@ -210,7 +199,7 @@ sub cmd_test_bmo { my $httpd_exit_f = run_cereal_and_httpd('-DACCESS_LOGS'); my $prove_exit_f = run_prove( - prove_cmd => ['prove', '-I/app', '-I/app/local/lib/perl5', @prove_args], + prove_cmd => ['prove', '-I/app', '-I/app/local/lib/perl5', @args], ); exit Future->wait_any($prove_exit_f, $httpd_exit_f)->get; @@ -220,7 +209,6 @@ sub run_prove { my (%param) = @_; my $prove_cmd = $param{prove_cmd}; - my $prove_dir = $param{prove_dir}; assert_httpd()->then(sub { my $loop = IO::Async::Loop->new; $loop->connect(socktype => 'stream', host => 'localhost', service => 5880,) @@ -229,7 +217,6 @@ sub run_prove { my $prove_exit_f = $loop->new_future; my $prove = IO::Async::Process->new( code => sub { - chdir $prove_dir if $prove_dir; my @cmd = (map { ref $_ eq 'CODE' ? $_->() : $_ } @$prove_cmd); warn "run @cmd\n"; exec @cmd; diff --git a/qa/config/generate_test_data.pl b/scripts/generate_test_data.pl similarity index 98% rename from qa/config/generate_test_data.pl rename to scripts/generate_test_data.pl index a08f598c46..54431e1c4d 100644 --- a/qa/config/generate_test_data.pl +++ b/scripts/generate_test_data.pl @@ -11,20 +11,7 @@ use strict; use warnings; - -use File::Basename; -use File::Spec; - -BEGIN { - require lib; - my $dir - = File::Spec->rel2abs(File::Spec->catdir(dirname(__FILE__), "..", "..")); - lib->import( - $dir, - File::Spec->catdir($dir, "lib"), - File::Spec->catdir($dir, qw(local lib perl5)) - ); -} +use lib qw(. lib local/lib/perl5); use Cwd; use File::Copy::Recursive qw(dircopy); @@ -34,7 +21,7 @@ BEGIN BEGIN { print "reading the config file...\n"; - my $conf_file = $ENV{BZ_QA_CONF_FILE} // "selenium_test.conf"; + my $conf_file = $ENV{BZ_QA_CONF_FILE} // "conf/selenium_test.conf"; if (@ARGV) { $conf_file = shift @ARGV; } diff --git a/t/001compile.t b/t/001compile.t index 1ce7386b63..67593dd956 100644 --- a/t/001compile.t +++ b/t/001compile.t @@ -14,13 +14,13 @@ use 5.10.1; use strict; use warnings; -use lib qw(. lib local/lib/perl5 t); +use lib qw(. lib local/lib/perl5); use Config; -use Support::Files; +use Bugzilla::Test::Files; use Test::More; BEGIN { - plan tests => @Support::Files::testitems + @Support::Files::test_files; + plan tests => @Bugzilla::Test::Files::testitems + @Bugzilla::Test::Files::test_files; use_ok('Bugzilla::Constants'); use_ok('Bugzilla::Install::Requirements'); @@ -69,7 +69,7 @@ sub compile_file { $libs .= join ' ', map {"-I\"$_\""} split /$Config{path_sep}/, $ENV{PERL5LIB}; } my $perl = qq{"$^X"}; - my $output = `$perl $libs -c$T -MSupport::Systemexec $file 2>&1`; + my $output = `$perl $libs -c$T -MBugzilla::Test::Systemexec $file 2>&1`; chomp $output; my $return_val = $?; $output =~ s/^\Q$file\E syntax OK$//ms; @@ -77,7 +77,7 @@ sub compile_file { ok(!$return_val, $file) or diag('--ERROR'); } -my @testitems = (@Support::Files::testitems, @Support::Files::test_files); +my @testitems = (@Bugzilla::Test::Files::testitems, @Bugzilla::Test::Files::test_files); my $file_features = map_files_to_features(); # Test the scripts by compiling them diff --git a/t/002goodperl.t b/t/002goodperl.t index a9cdd05d51..e50dbd5103 100644 --- a/t/002goodperl.t +++ b/t/002goodperl.t @@ -14,15 +14,15 @@ use 5.10.1; use strict; use warnings; -use lib qw(. lib local/lib/perl5 t); +use lib qw(. lib local/lib/perl5); -use Support::Files; +use Bugzilla::Test::Files; use Test::More tests => - (scalar(@Support::Files::testitems) + scalar(@Support::Files::test_files)) + (scalar(@Bugzilla::Test::Files::testitems) + scalar(@Bugzilla::Test::Files::test_files)) * 6; -my @testitems = (@Support::Files::test_files, @Support::Files::testitems); +my @testitems = (@Bugzilla::Test::Files::test_files, @Bugzilla::Test::Files::testitems); my @require_taint = qw(email_in.pl importxml.pl mod_perl.pl whine.pl); foreach my $file (@testitems) { diff --git a/t/004template.t b/t/004template.t index 61e895bf2f..73f73455e3 100644 --- a/t/004template.t +++ b/t/004template.t @@ -13,9 +13,9 @@ use 5.10.1; use strict; use warnings; -use lib qw(. lib local/lib/perl5 t); +use lib qw(. lib local/lib/perl5); -use Support::Templates; +use Bugzilla::Test::Templates; # Bug 137589 - Disable command-line input of CGI.pm when testing use CGI qw(-no_debug); diff --git a/t/005whitespace.t b/t/005whitespace.t index 492e3bee10..5cef279b05 100644 --- a/t/005whitespace.t +++ b/t/005whitespace.t @@ -13,24 +13,24 @@ use 5.10.1; use strict; use warnings; -use lib qw(. lib local/lib/perl5 t); +use lib qw(. lib local/lib/perl5); -use Support::Files; -use Support::Templates; +use Bugzilla::Test::Files; +use Bugzilla::Test::Templates; use File::Spec; use Test::More tests => ( - scalar(@Support::Files::testitems) - + scalar(@Support::Files::test_files) - + $Support::Templates::num_actual_files) + scalar(@Bugzilla::Test::Files::testitems) + + scalar(@Bugzilla::Test::Files::test_files) + + $Bugzilla::Test::Templates::num_actual_files) * 3; -my @testitems = (@Support::Files::testitems, @Support::Files::test_files); -for my $path (@Support::Templates::include_paths) { +my @testitems = (@Bugzilla::Test::Files::testitems, @Bugzilla::Test::Files::test_files); +for my $path (@Bugzilla::Test::Templates::include_paths) { push( @testitems, map(File::Spec->catfile($path, $_), - Support::Templates::find_actual_files($path)) + Bugzilla::Test::Templates::find_actual_files($path)) ); } diff --git a/t/006spellcheck.t b/t/006spellcheck.t index c764499571..18696a1098 100644 --- a/t/006spellcheck.t +++ b/t/006spellcheck.t @@ -14,12 +14,12 @@ use 5.10.1; use strict; use warnings; -use lib qw(. lib local/lib/perl5 t); -use Support::Files; +use lib qw(. lib local/lib/perl5); +use Bugzilla::Test::Files; # -1 because 006spellcheck.t must not be checked. -use Test::More tests => scalar(@Support::Files::testitems) - + scalar(@Support::Files::test_files) - 1; +use Test::More tests => scalar(@Bugzilla::Test::Files::testitems) + + scalar(@Bugzilla::Test::Files::test_files) - 1; # Capture the TESTOUT from Test::More or Test::Builder for printing errors. # This will handle verbosity for us automatically. @@ -37,7 +37,7 @@ my $fh; } } -my @testitems = (@Support::Files::testitems, @Support::Files::test_files); +my @testitems = (@Bugzilla::Test::Files::testitems, @Bugzilla::Test::Files::test_files); #add the words to check here: my @evilwords = qw( diff --git a/t/007util.t b/t/007util.t index a248520554..3b1fc3a297 100644 --- a/t/007util.t +++ b/t/007util.t @@ -13,8 +13,8 @@ use 5.10.1; use strict; use warnings; -use lib qw(. lib local/lib/perl5 t); -use Support::Files; +use lib qw(. lib local/lib/perl5); +use Bugzilla::Test::Files; use Test::More tests => 52; use DateTime; diff --git a/t/008filter.t b/t/008filter.t index 671b8ff813..65fe558152 100644 --- a/t/008filter.t +++ b/t/008filter.t @@ -19,12 +19,12 @@ use 5.10.1; use strict; use warnings; -use lib qw(. lib local/lib/perl5 t); +use lib qw(. lib local/lib/perl5); use Bugzilla::Constants; -use Support::Templates; +use Bugzilla::Test::Templates; use File::Spec; -use Test::More tests => $Support::Templates::num_actual_files; +use Test::More tests => $Bugzilla::Test::Templates::num_actual_files; use Cwd; # Undefine the record separator so we can read in whole files at once @@ -33,14 +33,14 @@ my $topdir = cwd; $/ = undef; our %safe; -foreach my $path (@Support::Templates::include_paths) { +foreach my $path (@Bugzilla::Test::Templates::include_paths) { $path =~ s|\\|/|g if ON_WINDOWS; # convert \ to / in path if on windows $path =~ m|template/([^/]+)/([^/]+)|; my $lang = $1; my $flavor = $2; chdir $topdir; # absolute path - my @testitems = Support::Templates::find_actual_files($path); + my @testitems = Bugzilla::Test::Templates::find_actual_files($path); chdir $topdir; # absolute path next unless @testitems; diff --git a/t/009bugwords.t b/t/009bugwords.t index 48a6015136..c9df6882ab 100644 --- a/t/009bugwords.t +++ b/t/009bugwords.t @@ -19,23 +19,23 @@ use 5.10.1; use strict; use warnings; -use lib qw(. lib local/lib/perl5 t); +use lib qw(. lib local/lib/perl5); -use Support::Files; -use Support::Templates; +use Bugzilla::Test::Files; +use Bugzilla::Test::Templates; use Bugzilla::Util; use File::Spec; -use Test::More tests => ($Support::Templates::num_actual_files); +use Test::More tests => ($Bugzilla::Test::Templates::num_actual_files); # Find all the templates my @testitems; -for my $path (@Support::Templates::include_paths) { +for my $path (@Bugzilla::Test::Templates::include_paths) { push( @testitems, map(File::Spec->catfile($path, $_), - Support::Templates::find_actual_files($path)) + Bugzilla::Test::Templates::find_actual_files($path)) ); } diff --git a/t/010dependencies.t b/t/010dependencies.t index 0d8fe6cb0b..d65205e9a0 100644 --- a/t/010dependencies.t +++ b/t/010dependencies.t @@ -14,9 +14,9 @@ use 5.10.1; use strict; use warnings; -use lib qw(. lib local/lib/perl5 t); +use lib qw(. lib local/lib/perl5); -use Support::Files; +use Bugzilla::Test::Files; use Test::More qw(no_plan); my %mods; @@ -34,7 +34,7 @@ use constant BASE_REGEX => qr/^use (?:base|parent) (?:-norequire, )?qw\(([^\)]+)/; # Extract all Perl modules. -foreach my $file (@Support::Files::testitems) { +foreach my $file (@Bugzilla::Test::Files::testitems) { if ($file =~ /^(.*)\.pm$/) { my $module = $1; $module =~ s#/#::#g; diff --git a/t/011pod.t b/t/011pod.t index 3c6eb200f8..1e3b9e91c0 100644 --- a/t/011pod.t +++ b/t/011pod.t @@ -13,12 +13,12 @@ use 5.10.1; use strict; use warnings; -use lib qw(. lib local/lib/perl5 t); +use lib qw(. lib local/lib/perl5); -use Support::Files; +use Bugzilla::Test::Files; use Pod::Checker; -use Test::More tests => scalar(@Support::Files::testitems); +use Test::More tests => scalar(@Bugzilla::Test::Files::testitems); # Capture the TESTOUT from Test::More or Test::Builder for printing errors. # This will handle verbosity for us automatically. @@ -36,7 +36,7 @@ my $fh; } } -my @testitems = @Support::Files::testitems; +my @testitems = @Bugzilla::Test::Files::testitems; foreach my $file (@testitems) { $file =~ s/\s.*$//; # nuke everything after the first space (#comment) diff --git a/t/012throwables.t b/t/012throwables.t index 4a5d9e0a58..e6c0a21999 100644 --- a/t/012throwables.t +++ b/t/012throwables.t @@ -20,8 +20,8 @@ use Bugzilla::Constants; use Bugzilla::WebService::Constants; use File::Spec; -use Support::Files; -use Support::Templates; +use Bugzilla::Test::Files; +use Bugzilla::Test::Templates; use Test::More; my %Errors = (); @@ -34,7 +34,7 @@ my %test_templates = (); my %test_modules = (); # Find all modules -foreach my $module (@Support::Files::testitems) { +foreach my $module (@Bugzilla::Test::Files::testitems) { $test_modules{$module} = (); } @@ -99,33 +99,52 @@ foreach my $file (keys %test_templates) { foreach my $file (keys %test_modules) { $file =~ s/\s.*$//; # nuke everything after the first space (#comment) next if (!$file); # skip null entries + next if ($file eq 'Bugzilla/QA/Tests.pm'); # skip this file since it contains test data if (!open(TMPL, $file)) { Register(\%test_modules, $file, "could not open file --WARNING"); next; } - my $lineno = 0; - while (my $line = ) { - last if $line =~ /^__END__/; # skip the POD (at least in - # Bugzilla/Error.pm) - $lineno++; - if ($line - =~ /^[^#]*\b(Throw(Code|User)Error|(user_)?error\s+=>)\s*\(?\s*["'](.*?)['"]/) - { - my $errtype; - - # If it's a normal ThrowCode/UserError - if ($2) { - $errtype = lc($2); - } + my $content = do { local $/; }; - # If it's an AUTH_ERROR tag - else { - $errtype = $3 ? 'user' : 'code'; - } - my $errtag = $4; - push @{$Errors{$errtype}{$errtag}{used_in}{$file}}, $lineno; + # Skip the POD (at least in Bugzilla/Error.pm) + $content =~ s/^__END__\b.*\z//ms; + + while ($content + =~ /^[^#\n]*\b(Throw(Code|User)Error|(user_)?error\s+=>)\s*\(?\s*["'](.*?)['"]/mg + ) + { + my $errtype; + + # If it's a normal ThrowCode/UserError + if ($2) { + $errtype = lc($2); } + + # If it's an AUTH_ERROR tag + else { + $errtype = $3 ? 'user' : 'code'; + } + my $errtag = $4; + + # Compute line number from match position in the slurped content + my $lineno = () = substr($content, 0, $-[0]) =~ /\n/g; + $lineno++; + push @{$Errors{$errtype}{$errtag}{used_in}{$file}}, $lineno; + } + + # Find any occurrences of ->code_error() or ->user_error() + while ($content + =~ /->(code|user)_error\(\s*["'](.*?)['"]\s*\)/mg + ) + { + my $errtype = $1; + my $errtag = $2; + + # Compute line number from match position in the slurped content + my $lineno = () = substr($content, 0, $-[0]) =~ /\n/g; + $lineno++; + push @{$Errors{$errtype}{$errtag}{used_in}{$file}}, $lineno; } close(TMPL); diff --git a/t/bmo/bounced-emails.t b/t/bmo/bounced-emails.t index d6b23e1417..f604a216cc 100644 --- a/t/bmo/bounced-emails.t +++ b/t/bmo/bounced-emails.t @@ -8,7 +8,7 @@ use strict; use warnings; use 5.10.1; -use lib qw( . lib qa/t/lib local/lib/perl5 ); +use lib qw( . lib local/lib/perl5 ); BEGIN { $ENV{LOG4PERL_CONFIG_FILE} = 'log4perl-t.conf'; @@ -18,7 +18,7 @@ BEGIN { use Bugzilla; use Bugzilla::Util qw(mojo_user_agent); use Mojo::URL; -use QA::Util; +use Bugzilla::QA::Util; use Test2::V0; use Test::Selenium::Remote::Driver; diff --git a/t/bmo/oauth2-client.t b/t/bmo/oauth2-client.t index c58de4ad7b..484eb287cc 100644 --- a/t/bmo/oauth2-client.t +++ b/t/bmo/oauth2-client.t @@ -8,10 +8,10 @@ use strict; use warnings; use 5.10.1; -use lib qw( . qa/t/lib local/lib/perl5 ); +use lib qw( . lib local/lib/perl5 ); use Mojo::Base -strict; -use QA::Util; +use Bugzilla::QA::Util; use Test::More skip_all => 'Temporarily disabled'; my ($sel, $config) = get_selenium(); diff --git a/t/bmo/passwords.t b/t/bmo/passwords.t index 93a26e61dc..55e62c72b4 100644 --- a/t/bmo/passwords.t +++ b/t/bmo/passwords.t @@ -4,10 +4,10 @@ use strict; use warnings; use autodie; -use lib qw( . qa/t/lib local/lib/perl5 ); +use lib qw( . lib local/lib/perl5 ); use Mojo::Base -strict; -use QA::Util; +use Bugzilla::QA::Util; use Test::More; # Bad passwords diff --git a/t/critic.t b/t/critic.t index 4b2d91ee0c..549282f48e 100644 --- a/t/critic.t +++ b/t/critic.t @@ -8,14 +8,14 @@ use 5.10.1; use strict; use warnings; -use lib qw(. lib local/lib/perl5 t); +use lib qw(. lib local/lib/perl5); -use Support::Files; +use Bugzilla::Test::Files; use Test::More; my @testitems = ( - @Support::Files::testitems, @Support::Files::test_files, - @Support::Files::scripts + @Bugzilla::Test::Files::testitems, @Bugzilla::Test::Files::test_files, + @Bugzilla::Test::Files::scripts ); my $ok = eval { require Test::Perl::Critic::Progressive };