Bugzilla – Attachment 181641 Details for
Bug 39771
The `data` attribute in job.yaml should be nullable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39771: Regression tests
Bug-39771-Regression-tests.patch (text/plain), 2.44 KB, created by
Tomás Cohen Arazi (tcohen)
on 2025-04-29 10:55:38 UTC
(
hide
)
Description:
Bug 39771: Regression tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2025-04-29 10:55:38 UTC
Size:
2.44 KB
patch
obsolete
>From 615e84c90dee5987ead95dcd486f3fe5585fd5cf Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 29 Apr 2025 07:51:30 -0300 >Subject: [PATCH] Bug 39771: Regression tests > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/api/v1/jobs.t | 54 +++++++++++++++++++++++++++++++++++- > 1 file changed, 53 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/api/v1/jobs.t b/t/db_dependent/api/v1/jobs.t >index 1037e9dbcb6..e159efb3be7 100755 >--- a/t/db_dependent/api/v1/jobs.t >+++ b/t/db_dependent/api/v1/jobs.t >@@ -18,7 +18,7 @@ > use Modern::Perl; > > use Test::NoWarnings; >-use Test::More tests => 32; >+use Test::More tests => 33; > use Test::Mojo; > > use t::lib::TestBuilder; >@@ -140,3 +140,55 @@ my $job_current = $builder->build_object( > } > > $schema->storage->txn_rollback; >+ >+subtest 'finished jobs' => sub { >+ >+ plan tests => 10; >+ >+ $schema->storage->txn_begin; >+ >+ my $password = 'thePassword123'; >+ my $patron = $builder->build_object( >+ { >+ class => 'Koha::Patrons', >+ value => { flags => 1 }, # superlibrarian >+ } >+ ); >+ $patron->set_password( { password => $password, skip_validation => 1 } ); >+ my $userid = $patron->userid; >+ >+ my $job = $builder->build_object( >+ { >+ class => 'Koha::BackgroundJobs', >+ value => { >+ status => 'new', >+ progress => 0, >+ size => 100, >+ type => 'batch_item_record_modification', >+ queue => 'default', >+ data => >+ '{"regex_mod":null,"report":{"total_records":1,"modified_fields":1,"modified_itemnumbers":[1]},"new_values":{"itemnotes":"xxx"},"record_ids":["1"],"exclude_from_local_holds_priority":null}', >+ } >+ } >+ ); >+ >+ $t->get_ok( "//$userid:$password@/api/v1/jobs/" . $job->id )->status_is(200)->json_is( $job->to_api ); >+ >+ $job->finish( { french => 'fries' } )->discard_changes; >+ >+ $t->get_ok( "//$userid:$password@/api/v1/jobs/" . $job->id )->status_is(200)->json_is( $job->to_api ); >+ >+ $job->set( >+ { >+ ended_on => undef, >+ data => undef, >+ } >+ )->store(); >+ >+ $job->finish()->discard_changes(); >+ >+ $t->get_ok( "//$userid:$password@/api/v1/jobs/" . $job->id )->status_is(200)->json_is( $job->to_api ) >+ ->json_is( '/data' => undef ); >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.49.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 39771
:
181641
|
181642
|
181643
|
181644
|
182079
|
182080