Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
Hide test results dialog when running the step
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Casters committed Nov 12, 2016
1 parent 2a83b92 commit fabac90
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
Expand Up @@ -186,7 +186,7 @@ protected void disableUnitTest(String unitTestName) {
protected void switchUnitTest(TransUnitTest targetTest, TransMeta transMeta) {
try {
DataSetHelper.getInstance().detachUnitTest();
DataSetHelper.getInstance().selectUnitTest(transMeta, targetTest);
DataSetHelper.selectUnitTest(transMeta, targetTest);
} catch (Exception exception) {
new ErrorDialog(Spoon.getInstance().getShell(),
BaseMessages.getString(PKG, "ShowUnitTestMenuExtensionPoint.ErrorSwitchingUnitTest.Title"),
Expand Down
Expand Up @@ -81,8 +81,10 @@ public void callExtensionPoint( LogChannelInterface log, Object object ) throws
} else {
log.logBasic( "Unit test '"+unitTest.getName()+"' failed, "+errors+" errors detected, "+results.size()+" comments to report." );

String dontShowResults = transMeta.getVariable(DataSetConst.VAR_DO_NOT_SHOW_UNIT_TEST_ERRORS, "N");

final Spoon spoon = Spoon.getInstance();
if (spoon!=null) {
if (spoon!=null && "N".equalsIgnoreCase(dontShowResults)) {
spoon.getShell().getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
Expand Down
5 changes: 5 additions & 0 deletions src/org/pentaho/di/dataset/steps/exectests/ExecuteTests.java
Expand Up @@ -163,6 +163,11 @@ private TransMeta loadTestTransformation(TransUnitTest test) throws KettleExcept
if (transMeta==null) {
return null;
}

// Don't show to unit tests results dialog in case of errors
//
transMeta.setVariable(DataSetConst.VAR_DO_NOT_SHOW_UNIT_TEST_ERRORS, "Y");

// Pass some data from the parent...
//
transMeta.setRepository(repository);
Expand Down
2 changes: 1 addition & 1 deletion src/org/pentaho/di/dataset/util/DataSetConst.java
Expand Up @@ -59,7 +59,7 @@ public class DataSetConst {
public static final String ATTR_STEP_TWEAK= "UnitTestStepTweak";

public static final String VAR_RUN_UNIT_TEST = "__UnitTest__";

public static final String VAR_DO_NOT_SHOW_UNIT_TEST_ERRORS = "__DontShowUnitTestErrors__";
public static final String ATTR_TRANS_SELECTED_UNIT_TEST_NAME = "SelectedUnitTest";

public static final String AREA_DRAWN_UNIT_ICON = "DrawnUnitTestIcon";
Expand Down

0 comments on commit fabac90

Please sign in to comment.