Description: Disable tests requiring network access (Mojolicious)
Forwarded: not-needed
Author: Nick Morrott <nickm@debian.org>
Reviewed-by: gregor herrmann <gregoa@debian.org>
Last-Update: 2022-12-31

--- a/t/v2-file.t
+++ b/t/v2-file.t
@@ -2,6 +2,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 post '/user' => sub {
   my $c = shift->openapi->valid_input or return;
--- a/t/v2-readonly.t
+++ b/t/v2-readonly.t
@@ -2,6 +2,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 post '/user' => sub {
   my $c = shift->openapi->valid_input or return;
--- a/t/v3-nullable.t
+++ b/t/v3-nullable.t
@@ -2,6 +2,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 
 my %data = (id => 42);
--- a/t/v3-body.t
+++ b/t/v3-body.t
@@ -2,6 +2,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 post '/test' => sub {
   my $c = shift;
--- a/t/v3-invalid_file_refs.t
+++ b/t/v3-invalid_file_refs.t
@@ -3,6 +3,8 @@
 use Test::More;
 use Mojolicious::Lite;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 get '/test' => sub {
   my $c = shift->openapi->valid_input or return;
   $c->render(status => 200, openapi => $c->param('pcversion'));
--- a/t/v3-invalid_file_refs_no_path.t
+++ b/t/v3-invalid_file_refs_no_path.t
@@ -3,6 +3,8 @@
 use Test::More;
 use Mojolicious::Lite;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 get '/test' => sub {
   my $c = shift->openapi->valid_input or return;
   $c->render(status => 200, openapi => $c->param('pcversion'));
--- a/t/v3-valid_file_refs.t
+++ b/t/v3-valid_file_refs.t
@@ -3,6 +3,8 @@
 use Test::More;
 use Mojolicious::Lite;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 get '/test' => sub {
   my $c = shift->openapi->valid_input or return;
   $c->render(status => 200, openapi => $c->param('pcversion'));
--- a/t/v3-style-array.t
+++ b/t/v3-style-array.t
@@ -2,6 +2,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 
 get '/pets' => sub {
--- a/t/basic-under-route-authenticate.t
+++ b/t/basic-under-route-authenticate.t
@@ -2,6 +2,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 my $auth = app->routes->under('/api')->to(
   cb => sub {
--- a/t/basic-autorender.t
+++ b/t/basic-autorender.t
@@ -2,6 +2,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 my %inline;
 
 {
--- a/t/basic-coerce.t
+++ b/t/basic-coerce.t
@@ -3,6 +3,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 my $coerced = t();
 $coerced->post_ok('/api/user')->status_is(200)->json_is('/age', 34);
 $coerced->post_ok('/api/user', json => [{}])->status_is(400)
--- a/t/basic-correct-order-of-paths.t
+++ b/t/basic-correct-order-of-paths.t
@@ -3,6 +3,8 @@
 use Test::More;
 use Mojo::Util 'encode';
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 
 post '/decode' => sub {
--- a/t/basic-custom-formats.t
+++ b/t/basic-custom-formats.t
@@ -2,6 +2,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 my $what_ever;
 get '/custom-format' => sub {
--- a/t/basic-empty-response.t
+++ b/t/basic-empty-response.t
@@ -3,6 +3,8 @@
 use Test::More;
 use Mojolicious::Lite;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 my $t = Test::Mojo->new;
 my ($res, $status);
 
--- a/t/basic-invalid-json-input.t
+++ b/t/basic-invalid-json-input.t
@@ -2,6 +2,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 post '/invalid' => sub {
   my $c = shift->openapi->valid_input or return;
--- a/t/basic-path-parameters.t
+++ b/t/basic-path-parameters.t
@@ -2,6 +2,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 
 post '/user/:id' => sub {
--- a/t/plugin-cors.t
+++ b/t/plugin-cors.t
@@ -2,6 +2,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 our $cors_callback = 'main::cors_exchange';
 
 use Mojolicious::Lite;
--- a/t/v2-collectionformat.t
+++ b/t/v2-collectionformat.t
@@ -2,6 +2,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 
 get '/header' => sub {
--- a/t/v2-discriminator.t
+++ b/t/v2-discriminator.t
@@ -2,6 +2,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 
 post '/pets' => sub {
--- a/t/v2-headers.t
+++ b/t/v2-headers.t
@@ -2,6 +2,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 my $what_ever;
 get '/headers' => sub {
--- a/t/basic-404-501.t
+++ b/t/basic-404-501.t
@@ -2,6 +2,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 package MyApp;
 use Mojo::Base 'Mojolicious';
 
--- a/t/basic-bundle.t
+++ b/t/basic-bundle.t
@@ -3,6 +3,8 @@
 use Test::More;
 use JSON::Validator::Schema::OpenAPIv2;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 # This test mimics what Mojolicious::Plugin::OpenAPI does when loading
 # a spec from a file that Mojolicious locates with a '..'
 # It checks that a $ref to something that's under /responses doesn't
--- a/t/basic-custom-renderer.t
+++ b/t/basic-custom-renderer.t
@@ -2,6 +2,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 
 my $age = 43;
--- a/t/basic-custom-validation.t
+++ b/t/basic-custom-validation.t
@@ -2,6 +2,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 
 my $age = 43;
--- a/t/basic-legacy-swagger2.t
+++ b/t/basic-legacy-swagger2.t
@@ -2,6 +2,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 post '/echo' => sub {
   my ($c, $data, $cb) = @_;
--- a/t/basic-mojo-placeholder.t
+++ b/t/basic-mojo-placeholder.t
@@ -3,6 +3,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 my $t = Test::Mojo->new(make_app());
 
 monkey_patch 'Myapp::Controller::Pet' => one => sub {
--- a/t/basic-mojo-route-names.t
+++ b/t/basic-mojo-route-names.t
@@ -2,6 +2,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 app->routes->namespaces(['MyApp::Controller']);
 get '/whatever' => sub { die 'Oh noes!' }, 'Whatever';
--- a/t/basic-register-plugin.t
+++ b/t/basic-register-plugin.t
@@ -3,6 +3,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 get(
   '/no-default-options/:id' => sub { $_[0]->render(openapi => {id => $_[0]->stash('id')}) },
--- a/t/jv-recursion.t
+++ b/t/jv-recursion.t
@@ -3,6 +3,8 @@
 use Test::More;
 use JSON::Validator::Schema::OpenAPIv2;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 TODO: {
   todo_skip
     'At this moment in spacetime, I do not know how to suppport both a recursive schema and a recusrive data structure',
--- a/t/plugin-security-extended-status.t
+++ b/t/plugin-security-extended-status.t
@@ -2,6 +2,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 
 get '/securitytest' => sub {
--- a/t/plugin-security-rules-not-defined.t
+++ b/t/plugin-security-rules-not-defined.t
@@ -2,6 +2,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 post '/global' => sub {
   my $c = shift->openapi->valid_input or return;
--- a/t/plugin-security-v2.t
+++ b/t/plugin-security-v2.t
@@ -2,6 +2,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 post '/global' => sub {
   my $c = shift->openapi->valid_input or return;
--- a/t/plugin-security-v3.t
+++ b/t/plugin-security-v3.t
@@ -2,6 +2,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 
 post '/global' => sub {
--- a/t/plugin-spec-renderer-doc.t
+++ b/t/plugin-spec-renderer-doc.t
@@ -3,6 +3,8 @@
 use Test::More;
 use Mojolicious;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 sub VERSION {1.42}
 
 {
--- a/t/plugin-spec-renderer-options.t
+++ b/t/plugin-spec-renderer-options.t
@@ -2,6 +2,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 
 get '/spec' => sub {
--- a/t/plugin-spec-renderer-v3.t
+++ b/t/plugin-spec-renderer-v3.t
@@ -3,6 +3,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 plugin OpenAPI => {url => path(__FILE__)->dirname->child(qw(spec v3-petstore.json))};
 
--- a/t/v2-defaults.t
+++ b/t/v2-defaults.t
@@ -2,6 +2,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 package Test::Controller::Echo;
 use Mojo::Base 'Mojolicious::Controller';
 
--- a/t/v2-id-prop.t
+++ b/t/v2-id-prop.t
@@ -2,6 +2,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 my $id = 'foo';
 get '/user' => sub {
--- a/t/v2-validate-schema.t
+++ b/t/v2-validate-schema.t
@@ -2,6 +2,8 @@
 use Test::More;
 use Mojolicious::Lite;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 eval { plugin OpenAPI => {url => 'data://main/invalid.json'} };
 like $@, qr{/info: Missing property}si, 'missing spec elements';
 
--- a/t/v3-basic.t
+++ b/t/v3-basic.t
@@ -3,6 +3,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 
 get '/pets/:petId' => sub {
--- a/t/v3-defaults.t
+++ b/t/v3-defaults.t
@@ -3,6 +3,8 @@
 use Test::More;
 use Mojolicious::Lite;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 get '/test' => sub {
   my $c = shift->openapi->valid_input or return;
   $c->render(status => 200, openapi => $c->param('pcversion'));
--- a/t/v3-file.t
+++ b/t/v3-file.t
@@ -2,6 +2,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 post '/upload' => sub {
   my $c = shift->openapi->valid_input or return;
--- a/t/v3-style-object.t
+++ b/t/v3-style-object.t
@@ -2,6 +2,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 
 get '/pets' => sub {
--- a/t/v3-tutorial.t
+++ b/t/v3-tutorial.t
@@ -2,6 +2,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 make_app();
 make_controller();
 
--- a/t/v3-writeonly.t
+++ b/t/v3-writeonly.t
@@ -2,6 +2,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 post '/required' => sub {
   my $c = shift->openapi->valid_input or return;
--- a/t/v2-tutorial.t
+++ b/t/v2-tutorial.t
@@ -2,6 +2,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 make_app();
 make_controller();
 
--- a/t/v2-basic.t
+++ b/t/v2-basic.t
@@ -3,6 +3,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 
 get '/pets/:petId' => sub {
--- a/t/v2-body.t
+++ b/t/v2-body.t
@@ -2,6 +2,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 for ('string', 'array') {
   my ($path, $name) = ("/body-$_", 'body' . ucfirst);
--- a/t/v3-bundle.t
+++ b/t/v3-bundle.t
@@ -3,6 +3,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 
 get '/pets' => sub {
--- a/t/v2-swagger.t
+++ b/t/v2-swagger.t
@@ -3,6 +3,8 @@
 use Test::Mojo;
 use Test::More;
 
+plan skip_all => "Unset NO_NETWORK to enable this test" if $ENV{NO_NETWORK};
+
 use Mojolicious::Lite;
 
 subtest 'check that we can load swagger.yaml' => sub {
