View source | View content page | Page history | Printable version   

Projects:Buildvalidations execution restriction/QA

Contents

Introduction

The main goal of the QA-Test Plan of this project is to ensure that the new execution approach makes buildvalidations be executed only when they are supposed to be executed, according to a possible dependency defined in the buildvalidation itself.

Automatic Tests

A new JUnit test case has been created and included as part of the ant task tests executed during CI.

This test covers all the possible dependencies that can be set for a buildvalidation execution when updating database. Besides it is include all the possible dependencies that can be set for a modulescript too. The code of the test can be found [ here].

Manual Tests

Defined in TestLink in Platform > [BVL] BuildValidation Limits test suite.

Besides to test the new functionality, some manual tests have been done. In order to execute this manual tests, some changes have been done in the same buildvalidation in order to cover some scenarios.

 
package org.openbravo.platform.ci.buildvalidation;
 
import java.util.ArrayList;
import java.util.List;
 
import org.apache.log4j.Logger;
import org.openbravo.base.ExecutionLimits;
import org.openbravo.buildvalidation.BuildValidation;
import org.openbravo.modulescript.OpenbravoVersion;
 
/**
 * This build validation is used for testing purposes. This buildvalidation should be executed
 * between 3.0PR16Q1 to 3.0PR17Q1. New Project of Build Validation boundaries will include into
 * distribution in 3.0PR17Q1.
 */
public class TestBuildValidation extends BuildValidation {
 
  private static Logger log4j = Logger.getLogger(TestBuildValidation.class);
 
  private final static int PR16Q1 = 28207;
  private final static int PR17Q1 = 40727; // not defined properly
 
  @Override
  protected ExecutionLimits getBuildValidationLimits() {
    return new ExecutionLimits("0", new OpenbravoVersion(3, 0, PR16Q1), new OpenbravoVersion(3, 0,
        PR17Q1));
  }
 
  @Override
  public List<String> execute() {
    log4j.warn("TestBuildValidation is executed. Boundaries for this BuildValidation are [3.0."
        + PR16Q1 + " - 3.0." + PR17Q1 + "].");
    return new ArrayList<String>();
  }
}
 

The code of the buildvalidation example can be downloaded from this public mercurial repository: org.openbravo.platform.ci.

For manual tests, limit versions of the buildvalidation have been changed in order to reproduced all scenarios. First of all, check current version of core module. In this case core module is in 3.0.30513.

Scenario 1: Boundaries smaller than currentVersion

Test Plan

  1. ERP should be in 3.0.30513 version.
  2. Update database with limits between [3.0.30510 - 3.0.30512]. TestBuildValidation must not be executed.
  3. Update database with limits between [null - 3.0.30512]. TestBuildValidation must not be executed.
  4. Update database with limits between [3.0.30510 - null]. TestBuildValidation must be executed.

Results

Test Result: CORRECT

Scenario 2: Boundaries contain currentVersion

Test Plan

  1. ERP should be in 3.0.30513 version.
  2. Update database with limits between [3.0.30510 - 3.0.30515]. TestBuildValidation must be executed.
  3. Update database with limits between [null - 3.0.30515]. TestBuildValidation must be executed.
  4. Update database with limits between [3.0.30510 - null]. TestBuildValidation must be executed.

Results

Test Result: CORRECT

Scenario 3: Boundaries bigger than currentVersion

Test Plan

  1. ERP should be in 3.0.30513 version.
  2. Update database with limits between [3.0.30514 - 3.0.30515]. TestBuildValidation must not be executed.
  3. Update database with limits between [null - 3.0.30515]. TestBuildValidation must be executed.
  4. Update database with limits between [3.0.30514 - null]. TestBuildValidation must not be executed.

Results

Test Result: CORRECT

Scenario 4: Installing a module with default behavior in executeOnInstall()

By default value is true.

Test Plan

  1. ERP should be in 3.0.30513 version.
  2. Install a Cash VAT Management module.
    1. hg clone https://code.openbravo.com/erp/mods/org.openbravo.module.cashvat
    2. Version module is 1.0.300 and ID of the module is 95CA76BB409646CC8D9B68CD311CB415.
  3. Updated Buildvalidation:
    1. Dependency with Cash VAT Management module.
    2. Execution versions between [1.0.350, null].
    3. Compile buildvalidation: ant compile.buildvalidation -Dmodule=org.openbravo.platform.ci
  4. First Update database (ant smartbuild -Dlocal=no). TestBuildValidation must be executed.
  5. Second Update database (ant smartbuild -Dlocal=no). TestBuildValidation must not be executed.

Results

Test Result: CORRECT

 
------ LOG FIRST EXECUTION ------
     [java] 239  [main] INFO  org.openbravo.buildvalidation.BuildValidation 
- Executing buildValidation: org.openbravo.advpaymentmngt.buildvalidation.WrongPaymentScheduleDetailsCheck
     [java] 271  [main] INFO  org.openbravo.buildvalidation.BuildValidation 
- Executing buildValidation: org.openbravo.platform.ci.buildvalidation.TestBuildValidation
     [java] 279  [main] WARN  org.openbravo.platform.ci.buildvalidation.TestBuildValidation 
- '''TestBuildValidation is executed. Boundaries for this BuildValidation are [1.0.350 - null].'''
 
update.database:
      [sql] Executing commands
      [sql] 2 of 2 SQL statements executed successfully
 
------ SECOND EXECUTION ------
     [java] 242  [main] INFO  org.openbravo.buildvalidation.BuildValidation 
- Executing buildValidation: org.openbravo.advpaymentmngt.buildvalidation.WrongPaymentScheduleDetailsCheck
     [java] 268  [main] DEBUG  org.openbravo.base.ExecutionLimitBaseProcess 
- '''Not necessary to execute BuildValidation: org.openbravo.platform.ci.buildvalidation.TestBuildValidation'''
     [java] 281  [main] DEBUG  org.openbravo.base.ExecutionLimitBaseProcess 
- Dependent module current version (1.0.300) is not between BuildValidation execution limits: first version = 1.0.350, last version = null
 
update.database:
      [sql] Executing commands
      [sql] 2 of 2 SQL statements executed successfully
 

Scenario 5: Installing a module updating behaviour in executeOnInstall()

In this case value is updated to false.

Test Plan

  1. ERP should be in 3.0.30513 version.
  2. Install a Cash VAT Management module.
    1. hg clone https://code.openbravo.com/erp/mods/org.openbravo.module.cashvat
    2. Version module is 1.0.300 and ID of the module is 95CA76BB409646CC8D9B68CD311CB415.
  3. Updated Buildvalidation:
    1. Dependency with Cash VAT Management module.
    2. Execution versions between [1.0.350, null].
    3. Overriddes executeOnInstall() method and return false value.
    4. Compile buildvalidation: ant compile.buildvalidation -Dmodule=org.openbravo.platform.ci
  4. First Update database (ant smartbuild -Dlocal=no). TestBuildValidation must not be executed.
  5. Second Update database (ant smartbuild -Dlocal=no). TestBuildValidation must not be executed.

Results

Test Result: CORRECT

 
------ LOG FIRST EXECUTION ------
     [java] 241  [main] INFO  org.openbravo.buildvalidation.BuildValidation 
- Executing buildValidation: org.openbravo.advpaymentmngt.buildvalidation.WrongPaymentScheduleDetailsCheck
     [java] 272  [main] DEBUG  org.openbravo.base.ExecutionLimitBaseProcess 
- '''Not necessary to execute BuildValidation: org.openbravo.platform.ci.buildvalidation.TestBuildValidation'''
     [java] 288  [main] DEBUG  org.openbravo.base.ExecutionLimitBaseProcess 
- Dependent module current version (1.0.300) is not between BuildValidation execution limits: first version = 1.0.350, last version = null
 
update.database:
      [sql] Executing commands
      [sql] 2 of 2 SQL statements executed successfully
 
------ SECOND EXECUTION ------
     [java] 245  [main] INFO  org.openbravo.buildvalidation.BuildValidation 
- Executing buildValidation: org.openbravo.advpaymentmngt.buildvalidation.WrongPaymentScheduleDetailsCheck
     [java] 274  [main] DEBUG  org.openbravo.base.ExecutionLimitBaseProcess 
- '''Not necessary to execute BuildValidation: org.openbravo.platform.ci.buildvalidation.TestBuildValidation'''
     [java] 292  [main] DEBUG  org.openbravo.base.ExecutionLimitBaseProcess 
- Dependent module current version (1.0.300) is not between BuildValidation execution limits: first version = 1.0.350, last version = null
 
update.database:
      [sql] Executing commands
      [sql] 2 of 2 SQL statements executed successfully
 

Retrieved from "http://wiki.openbravo.com/wiki/Projects:Buildvalidations_execution_restriction/QA"

This page has been accessed 1,654 times. This page was last modified on 2 November 2016, at 11:19. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.