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

Testcase platform #27

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/main/java/hudson/plugins/testlink/TestLinkBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,10 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher,
}

for(TestCaseWrapper tcw : automatedTestCases) {
testLinkSite.getReport().addTestCase(tcw);
if(LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, "TestLink automated test case ID [" + tcw.getId() + "], name [" +tcw.getName()+ "]");
}
testLinkSite.getReport().addTestCase(tcw);
if(LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, "TestLink automated test case ID [" + tcw.getId() + "], name [" + tcw.getName() + "], platform [" + tcw.getPlatform() + "]");
}
}

listener.getLogger().println(Messages.TestLinkBuilder_ExecutingSingleBuildSteps());
Expand Down Expand Up @@ -471,4 +471,4 @@ public String getDisplayName() {
public Descriptor<Builder> getDescriptor() {
return (TestLinkBuilderDescriptor) super.getDescriptor();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ public void checkRoles(RoleChecker roleChecker) throws SecurityException {
for (TestCaseWrapper automatedTestCase : automatedTestCases) {
final String[] commaSeparatedValues = automatedTestCase
.getKeyCustomFieldValues(this.keyCustomField);
final String testCasePlatform = automatedTestCase.getPlatform();
for (String value : commaSeparatedValues) {
String tapFileNameWithoutExtension = key;
int leftIndex = 0;
Expand All @@ -153,7 +154,8 @@ public void checkRoles(RoleChecker roleChecker) throws SecurityException {
tapFileNameWithoutExtension = tapFileNameWithoutExtension.substring(leftIndex,
tapFileNameWithoutExtension.lastIndexOf('.'));
}
if (tapFileNameWithoutExtension.equals(value)) {
if ( (testCasePlatform != null && tapFileNameWithoutExtension.equals(value+"-"+testCasePlatform)) ||
(tapFileNameWithoutExtension.equals(value)) ) {
this.updateTestCase(testSets, key, automatedTestCase, value, build, listener, testlink);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ public TestCaseWrapper(TestCase testCase) {
this.notes = new StringBuilder();
this.attachments = new LinkedList<Attachment>();
this.customFieldAndStatus = new HashMap<String, ExecutionStatus>();
if (this.testCase.getPlatform() != null) {
this.setPlatform(this.testCase.getPlatform().getName());
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public final class TestLinkHelper {
private static final String TESTLINK_TESTCASE_TESTPROJECT_ID = "TESTLINK_TESTCASE_TESTPROJECTID";
private static final String TESTLINK_TESTCASE_AUTHOR_ENVVAR = "TESTLINK_TESTCASE_AUTHOR";
private static final String TESTLINK_TESTCASE_SUMMARY_ENVVAR = "TESTLINK_TESTCASE_SUMMARY";
private static final String TESTLINK_TESTCASE_PLATFORM_ENVVAR = "TESTLINK_TESTCASE_PLATFORM";
private static final String TESTLINK_BUILD_NAME_ENVVAR = "TESTLINK_BUILD_NAME";
private static final String TESTLINK_TESTPLAN_NAME_ENVVAR = "TESTLINK_TESTPLAN_NAME";
private static final String TESTLINK_TESTPROJECT_NAME_ENVVAR = "TESTLINK_TESTPROJECT_NAME";
Expand Down Expand Up @@ -187,6 +188,7 @@ public static Map<String, String> createTestLinkEnvironmentVariables(TestCaseWra
testLinkEnvVar.put( TESTLINK_TESTCASE_TESTPROJECT_ID, ""+testCase.getTestProjectId() );
testLinkEnvVar.put( TESTLINK_TESTCASE_AUTHOR_ENVVAR, ""+testCase.getAuthorLogin() );
testLinkEnvVar.put( TESTLINK_TESTCASE_SUMMARY_ENVVAR, StringUtils.defaultIfEmpty(testCase.getSummary(), "") );
testLinkEnvVar.put( TESTLINK_TESTCASE_PLATFORM_ENVVAR, StringUtils.defaultIfEmpty(testCase.getPlatform(), "") );
testLinkEnvVar.put( TESTLINK_BUILD_NAME_ENVVAR, StringUtils.defaultIfEmpty(build.getName(), ""));
testLinkEnvVar.put( TESTLINK_TESTPLAN_NAME_ENVVAR, StringUtils.defaultIfEmpty(testPlan.getName(), ""));
testLinkEnvVar.put( TESTLINK_TESTPROJECT_NAME_ENVVAR, StringUtils.defaultIfEmpty(testProject.getName(), ""));
Expand Down Expand Up @@ -387,6 +389,8 @@ public static String createReportSummaryDetails(Report report, Report previous)
builder.append("</th><th>");
builder.append(Messages.ReportSummary_Details_Name());
builder.append("</th><th>");
builder.append(Messages.ReportSummary_Details_Platform());
builder.append("</th><th>");
builder.append(Messages.ReportSummary_Details_TestProjectId());
builder.append("</th><th>");
builder.append(Messages.ReportSummary_Details_ExecutionStatus());
Expand All @@ -400,6 +404,7 @@ public static String createReportSummaryDetails(Report report, Report previous)
builder.append("<td>"+tc.getFullExternalId()+"</td>");
builder.append("<td>"+tc.getVersion()+"</td>");
builder.append("<td>"+tc.getName()+"</td>");
builder.append("<td>"+tc.getPlatform()+"</td>");
builder.append("<td>"+tc.getTestProjectId()+"</td>");
builder.append("<td>"+TestLinkHelper.getExecutionStatusTextColored( tc.getExecutionStatus() )+"</td>\n");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,6 @@ ReportSummary.Details.TestCaseId=Test case ID
ReportSummary.Details.TestCaseExternalId=Test case external ID
ReportSummary.Details.Version=Version
ReportSummary.Details.Name=Name
ReportSummary.Details.Platform=Platform
ReportSummary.Details.TestProjectId=Test project ID
ReportSummary.Details.ExecutionStatus=Execution status
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,6 @@ ReportSummary.Details.TestCaseId=Test case ID
ReportSummary.Details.TestCaseExternalId=Test case external ID
ReportSummary.Details.Version=Version
ReportSummary.Details.Name=Name
ReportSummary.Details.Platform=Platform
ReportSummary.Details.TestProjectId=Test project ID
ReportSummary.Details.ExecutionStatus=Execution status
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,6 @@ ReportSummary.Details.TestCaseId=ID del caso de prueba
ReportSummary.Details.TestCaseExternalId=ID externo del caso de prueba
ReportSummary.Details.Version=Versi\uFFFDn
ReportSummary.Details.Name=Nombre
ReportSummary.Details.Platform=Plataforma
ReportSummary.Details.TestProjectId=ID del proyecto de prueba
ReportSummary.Details.ExecutionStatus=Status de ejecuci\uFFFDn
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ TestLinkBuilder.ShowFoundTestResults={0} r\u00e9sultats de test trouv\u00e9s.\n
TestLinkBuilder.MergingEnvVars=Fusion des variable d'environnement du build avec les variables de TestLink.\n
TestLinkBuilder.FailedToUpdateTL=Echec de la mise \u00e0 jour des r\u00e9sultats de test de TestLink: {0}.
TestLinkBuilder.MandatoryProperty=Cette propri\u00e9t\u00e9 est obligatoire.
TestLinkBuilder.PlatformNotFound=Platform {0} not found.\n
TestLinkBuilder.PlatformNotFound=Plate-forme {0} pas trouv\uc3a9.\n

Results.LookingForTestResults=Recherche du r\u00e9sutat du cas de test de TestLink.\n
Results.ErrorToLookForTestResults=Une erreur est survenue lors de la tentative de r\u00e9cup\u00e9ration des r\u00e9sultats de test: {0}
Expand Down Expand Up @@ -63,5 +63,6 @@ ReportSummary.Details.TestCaseId=ID du cas de test
ReportSummary.Details.TestCaseExternalId=Externe ID du cas de test
ReportSummary.Details.Version=Version
ReportSummary.Details.Name=Nom
ReportSummary.Details.Platform=Plate-forme
ReportSummary.Details.TestProjectId=ID du projet de test
ReportSummary.Details.ExecutionStatus=Etat d'ex\u00e9cution
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,6 @@ ReportSummary.Details.TestCaseId=ID do caso de teste
ReportSummary.Details.TestCaseExternalId=ID externo do caso de teste
ReportSummary.Details.Version=Vers\uFFFDo
ReportSummary.Details.Name=Nome
ReportSummary.Details.Platform=Plataforma
ReportSummary.Details.TestProjectId=ID do projeto de teste
ReportSummary.Details.ExecutionStatus=Status de execu\uFFFD\uFFFDo