Skip to content

Commit

Permalink
Rename Backend_Test_Agent to Backend in DB
Browse files Browse the repository at this point in the history
For messages generated by the backend, store them as the “Backend”
module instead of “Backend_Test_Agent”. The use of mixed case with
underscores is unsatisfactory and the test agent is the only place in
the backend that generates these messages.

In essence, “Backend” could be a synonym for “System”, but it’s better
to keep the Engine’s system messages separate from the Backend’s.
  • Loading branch information
marc-vanderwal committed Jun 3, 2024
1 parent 35b12e7 commit 2e0e172
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/Zonemaster/Backend/DB.pm
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ sub process_unfinished_tests {
my $msg = Zonemaster::Engine::Logger::Entry->new(
{
level => "CRITICAL",
module => "Backend_Test_Agent",
module => "Backend",
testcase => "",
tag => "UNABLE_TO_FINISH_TEST",
args => { max_execution_time => $test_run_timeout },
Expand Down Expand Up @@ -860,7 +860,7 @@ sub process_dead_test {
my $msg = Zonemaster::Engine::Logger::Entry->new(
{
level => "CRITICAL",
module => "Backend_Test_Agent",
module => "Backend",
testcase => "",
tag => "TEST_DIED",
args => {},
Expand Down
2 changes: 1 addition & 1 deletion lib/Zonemaster/Backend/Translator.pm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ sub _build_all_tag_descriptions {
my ( $class ) = @_;

my $all_tag_descriptions = Zonemaster::Engine::Translator::_build_all_tag_descriptions();
$all_tag_descriptions->{Backend_Test_Agent} = \%TAG_DESCRIPTIONS;
$all_tag_descriptions->{Backend} = \%TAG_DESCRIPTIONS;
return $all_tag_descriptions;
}

Expand Down
4 changes: 2 additions & 2 deletions share/patch/patch_db_zonemaster_backend_ver_11.2.0.pl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ sub _update_result_entries {

$dbh->do(<<SQL) or die 'Migration failed';
UPDATE result_entries
SET module = 'Backend_Test_Agent'
WHERE module = 'BACKEND_TEST_AGENT';
SET module = 'Backend'
WHERE upper(module) = 'BACKEND_TEST_AGENT';
SQL
}
2 changes: 1 addition & 1 deletion t/translator.t
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ like $translation, qr/cass\x{e9}e/,
###

$message = {
module => 'Backend_Test_Agent',
module => 'Backend',
testcase => '',
timestamp => '59',
level => 'CRITICAL',
Expand Down

0 comments on commit 2e0e172

Please sign in to comment.