Skip to content

Commit

Permalink
Fix tests due to postgres error msg filtered in wrong language
Browse files Browse the repository at this point in the history
Eg by calling `make test TESTS=t/api/04-jobs.t`
  • Loading branch information
asdil12 committed Jul 4, 2023
1 parent 7f4be1c commit f6f8f96
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ CRE ?= podman
# avoid localized error messages (that are matched against in certain cases)
LC_ALL = C.utf8
LANGUAGE =
LANG = C.utf8
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
current_dir := $(patsubst %/,%,$(dir $(mkfile_path)))
container_env_file := "$(current_dir)/container.env"
Expand Down
16 changes: 8 additions & 8 deletions t/ui/21-admin-needles.t
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,9 @@ subtest 'custom needles search' => sub {

@needle_trs = $driver->find_elements('#needles tbody tr');
is(scalar(@needle_trs), 2, 'only show five_month and five_month-undef needles');
my @needle_tds = $driver->find_child_elements($needle_trs[0], 'td', 'css');
my @needle_tds = $driver->find_child_elements($needle_trs[1], 'td', 'css');
is($needle_tds[1]->get_text(), 'five_month.json', 'search five_month needle correctly');
@needle_tds = $driver->find_child_elements($needle_trs[1], 'td', 'css');
@needle_tds = $driver->find_child_elements($needle_trs[0], 'td', 'css');
is($needle_tds[1]->get_text(), 'five_month-undef.json', 'search five_month-undef needle correctly');

$last_match_options[7]->click();
Expand Down Expand Up @@ -348,23 +348,23 @@ subtest 'custom needles search' => sub {
wait_for_ajax(msg => 'custom needle seen "not last" and match "not last" range', with_minion => $minion);
@needle_trs = $driver->find_elements('#needles tbody tr');
is(scalar(@needle_trs), 2, 'show seven_month and seven_month-undef');
@needle_tds = $driver->find_child_elements($needle_trs[0], 'td', 'css');
is($needle_tds[1]->get_text(), 'seven_month.json', 'search seven_month needle correctly');
@needle_tds = $driver->find_child_elements($needle_trs[1], 'td', 'css');
is($needle_tds[1]->get_text(), 'seven_month.json', 'search seven_month needle correctly');
@needle_tds = $driver->find_child_elements($needle_trs[0], 'td', 'css');
is($needle_tds[1]->get_text(), 'seven_month-undef.json', 'search seven_month-undef needle correctly');

$last_seen_options[0]->click();
$last_match_options[6]->click();
wait_for_ajax(msg => '"all time" seen and "not last two months" match', with_minion => $minion);
@needle_trs = $driver->find_elements('#needles tbody tr');
is(scalar(@needle_trs), 4, 'show all needles');
@needle_tds = $driver->find_child_elements($needle_trs[0], 'td', 'css');
@needle_tds = $driver->find_child_elements($needle_trs[3], 'td', 'css');
is($needle_tds[1]->get_text(), 'five_month.json', 'search five_month needle correctly');
@needle_tds = $driver->find_child_elements($needle_trs[1], 'td', 'css');
is($needle_tds[1]->get_text(), 'five_month-undef.json', 'search five_month-undef needle correctly');
@needle_tds = $driver->find_child_elements($needle_trs[2], 'td', 'css');
is($needle_tds[1]->get_text(), 'five_month-undef.json', 'search five_month-undef needle correctly');
@needle_tds = $driver->find_child_elements($needle_trs[1], 'td', 'css');
is($needle_tds[1]->get_text(), 'seven_month.json', 'search seven_month needle correctly');
@needle_tds = $driver->find_child_elements($needle_trs[3], 'td', 'css');
@needle_tds = $driver->find_child_elements($needle_trs[0], 'td', 'css');
is($needle_tds[1]->get_text(), 'seven_month-undef.json', 'search seven_month-undef needle correctly');
};

Expand Down

0 comments on commit f6f8f96

Please sign in to comment.