Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return final value of package variables #199

Merged
merged 9 commits into from
Aug 21, 2020

Conversation

MartinGroscheTT
Copy link
Collaborator

@MartinGroscheTT MartinGroscheTT commented Aug 17, 2020

Resolves #138

Screenshots:

image

@MartinGroscheTT MartinGroscheTT added feature New feature request ecu-test labels Aug 17, 2020
@MartinGroscheTT MartinGroscheTT added this to the 2.19.0 milestone Aug 17, 2020
@MartinGroscheTT MartinGroscheTT self-assigned this Aug 17, 2020
@@ -71,13 +72,20 @@
*/
public static final String TEST_TIMEOUT = "TEST_TIMEOUT_";

/**
* Build environment variable part for the timeout running the test.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong description

@@ -90,6 +98,9 @@ public void buildEnvironmentFor(@Nonnull final Run r, @Nonnull final EnvVars env
envs.put(PREFIX + TEST_REPORT + id, action.getTestReportDir());
envs.put(PREFIX + TEST_RESULT + id, action.getTestResult());
envs.put(PREFIX + TEST_TIMEOUT + id, String.valueOf(action.getTimeout()));
for (Map.Entry<String, String> outParam : outParams.entrySet()) {
envs.put(PREFIX + TEST_RETVAL + outParam.getKey() + "_" + id, outParam.getValue());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

param name is the key, no need for id

this.testFile = StringUtils.trimToEmpty(testFile);
this.testConfig = testConfig;
this.executionConfig = executionConfig;
this.outputParameters = outParams;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

param names should match

@@ -246,18 +270,22 @@ private void setGlobalConstants(final ETComClient comClient, final Map<String, S
private final String testResult;
private final String testReportDir;
private final boolean isAborted;
private final Map<String, String> outputParam;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be consistent with naming, see AbstractTestClient.java

this.testResult = testResult;
this.testReportDir = testReportDir;
this.isAborted = isAborted;
this.outputParam = outParam;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

param names should match

@@ -24,6 +24,8 @@ ImportProjectBuilder.DisplayName=[TT] Projekte importieren
ImportProjectBuilder.PrzFileExtension=Archiv muss vom Dateityp ".prz" sein.
ImportProjectConfig.DisplayName=Projekt aus Testmanagementsystem importieren
ImportProjectDirConfig.DisplayName=Projektverzeichnis aus Testmanagementsystem importieren
PackageOutputParameter.InvalidName=Parameteroutputname muss alphanumerisch sein. Er kann Unterstriche \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above

@@ -0,0 +1,17 @@
<!--
Copyright (c) 2015-2019 TraceTronic GmbH
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2020

@@ -0,0 +1,7 @@
#
# Copyright (c) 2015-2019 TraceTronic GmbH
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2020

@@ -0,0 +1,8 @@
#
# Copyright (c) 2015-2019 TraceTronic GmbH
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2020

@@ -0,0 +1,93 @@
/*
* Copyright (c) 2015-2019 TraceTronic GmbH
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2020

Copy link
Contributor

@cpoenisch cpoenisch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add new build var to README#environment-variables

#
# SPDX-License-Identifier: BSD-3-Clause
#
outputParameters.add=Add Output Parameter
outputParameters.advanced=Package Output Parameter
outputParameters.description=The configured package output parameter remain available throughout the entire test \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

description is misleading

#
# SPDX-License-Identifier: BSD-3-Clause
#
outputParameters.add=Output Parameter hinzuf\u00FCgen
outputParameters.advanced=Package Output Parameter
outputParameters.description=Die konfigurierten Package-Output-Parameter stehen w\u00E4hrend der Testausf\u00FChrung \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

description is misleading

@@ -24,6 +24,8 @@ ImportProjectBuilder.DisplayName=[TT] Projekte importieren
ImportProjectBuilder.PrzFileExtension=Archiv muss vom Dateityp ".prz" sein.
ImportProjectConfig.DisplayName=Projekt aus Testmanagementsystem importieren
ImportProjectDirConfig.DisplayName=Projektverzeichnis aus Testmanagementsystem importieren
PackageOutputParameter.InvalidName=R\u00FCckgabe-Parameter muss alphanumerisch sein. Er kann Unterstriche \
enthalten aber darf nicht mit einer Zahl beginnen oder Umlaute beinhalten.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comma before "aber"

<j:set var="varName" value="${outParam.getKey()}"/>
<tr class="child-${testId}">
<td class="tooltip" tooltip="${%outputParameters}">
TT_TEST_RETVAL_${varName}_${testId}</td>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testId is obsolete

@@ -74,6 +74,7 @@ public void testWithTestPackageEnvInvisibleAction() throws Exception {
envVars.get(TestEnvContributor.PREFIX + TestEnvContributor.TEST_RESULT + testId));
assertEquals("TT_TEST_TIMEOUT_0 should match env action", String.valueOf(testEnvAction.getTimeout()),
envVars.get(TestEnvContributor.PREFIX + TestEnvContributor.TEST_TIMEOUT + testId));
assertEquals("TT_TEST_RETVAL_0 should not exist",0, testEnvAction.getOutParams().size());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check positive case here

@@ -39,6 +40,7 @@
private String testReportDir;
private String testResult;
private boolean isAborted;
private Map<String, String> outputParameters;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move to PackageClient class

@cpoenisch cpoenisch merged commit 84ab9ee into master Aug 21, 2020
@cpoenisch cpoenisch deleted the i138-return-final-value-of-package-variables branch August 21, 2020 12:50
cpoenisch pushed a commit that referenced this pull request Aug 27, 2020
* output parameter option in package config added

* return value and display for output parameter implemented

* review notes added

* checkstyle warning fixed

* tests and review notes added

* packageInfo reverted

* Correct naming for test info holder of packages

* Tweak used wording in translations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Return final value of package variables
2 participants