The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Test::AutoBuild::Stage::Group - Groups several stages together

SYNOPSIS

  use Test::AutoBuild::Stage::Group

DESCRIPTION

This stage groups a number of stages together into a single logical stage. The primary reason for such a setup is to allow one or more of the sub-stages to fail, without terminating the entire build process. For example, by grouping the Build and ISOGenerator stages together it is possible to have the ISOGenerator stage skipped whenever the Build stage fails, but still have all the post-build output stages run to generate status pages, etc.

CONFIGURATION

In addition to the standard parameters defined by the Test::AutoBuild::Stage module, this module also handles the optional stages parameter to specify a list of sub-stages. Sub-stages are listed in the same format as top level stages, ie an array of hashes.

EXAMPLE

  {
    name = build
    label = Build group
    module = Test::AutoBuild::Stage::Group
    # Don't abort entire cycle if the module build fails
    critical = 0
    stages = (
      # Basic build
      {
        name = build
        label = Build
        module = Test::AutoBuild::Stage::Build
        options = {
          ...snip build options...
        }
      }
      # Generate isos
      {
        name = iso
        label = ISO image generator
        module = Test::AutoBuild::Stage::ISOGenetator
        options = {
          ...snip options...
        }
      }
    )
  }

METHODS

$stage->init(%params);

Overrides the super-class to add in handling of the optional stages parameter for defining sub-stages. It is not neccessary to call this method, since it is called by the new method automatically.

my @stages = $stage->stages();

Retrieves the list of sub-stages that belong to this group. The elements in the array are instances of Test::AutoBuild::Stage module.

$stage->process($runtime);

Runs all sub-stages returned by the stages method. If any sub-stages fails & that stage is marked as critical, this stage will be marked as failing and return control immediately. If the sub-stage is non-critical, then the processing will continue onto the next sub-stage.

AUTHORS

Daniel Berrange <dan@berrange.com> Dennis Gregorovic <dgregorovic@alum.mit.edu>

COPYRIGHT

Copyright (C) 2004 Red Hat, Inc.

SEE ALSO

perl(1), Test::AutoBuild::Stage