Sergey Petrunya <[email protected]> writes:

>   MBUG#442254: mysql-test-run --embedded fails on Windows with: ERROR: .opt 
> file references 'EXAMPLE_PLUGIN_OPT'
>   - Make mysql-test-run keep track of what variables it could be expected to 
> set but didn't, 
>     and skip the test if its .opt file uses such variable
>     (note: we can't disable using --include/have_smth.inc approach because it 
> requires that mysqltest can be
>      successfully started before the have_smth check is performed, and ".opt 
> file references..." error occurs
>      before mysqltest is started)

> @@ -1923,6 +1929,11 @@
>  
>      $ENV{'HA_EXAMPLE_SO'}="'".$plugin_filename."'";
>      
> $ENV{'EXAMPLE_PLUGIN_LOAD'}="--plugin_load=;EXAMPLE=".$plugin_filename.";";
> +  } else {
> +    $unsupported_env_variables .= "EXAMPLE_PLUGIN ";
> +    $unsupported_env_variables .= "EXAMPLE_PLUGIN_OPT ";
> +    $unsupported_env_variables .= "HA_EXAMPLE_SO ";
> +    $unsupported_env_variables .= "EXAMPLE_PLUGIN_LOAD ";
>    }

In this case, I think it is simpler and better to just set the variables to
empty here. Then the plugin tests will be skipped by
include/have_example_plugin.inc.

  else {
    for (qw(EXAMPLE_PLUGIN EXAMPLE_PLUGIN_OPT HA_EXAMPLE_SO
            EXAMPLE_PLUGIN_LOAD)) {
      $ENV{$_}= '';
    }
  }

In addition/instead, you might also consider adding
include/have_example_plugin.inc to the list @tags in
mysql-test/lib/mtr_cases.pm. Then add in sub collect_one_test_case at the
place where there are other similar checks:

  if ( $tinfo->{'example_plugin_test'} )
  {
    if ( !$ENV{'EXAMPLE_PLUGIN'} )
    {
      $tinfo->{'skip'}= 1;
      $tinfo->{'comment'}= "Test requires the 'example' plugin";
      return $tinfo;
    }
  }

This will make mysql-test-run not even attempt to start the server, avoiding
the problem with the .opt file.

My suggestion is to do both, or do either one if you prefer.

 - Kristian.

_______________________________________________
Mailing list: https://launchpad.net/~maria-developers
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp

Reply via email to