Exemplo n.º 1
0
        static GetDetailedLabRunStatusResponse JenkinsGetLabRunDetails(int LabrunId)
        {
            var request = new GetDetailedLabRunStatusRequest
            {
                LabRunId = LabrunId
            };

            var client = new LabRunServiceClient();
            client.GetDetailedLabRunStatus(request);
            var labRunDetailedStatus = client.GetDetailedLabRunStatus(request);

            client.Close();

            FileStream fs = new FileStream(LabrunId.ToString() + ".html", FileMode.Append);
            StreamWriter sw = new StreamWriter(fs);
            sw.WriteLine(@"
            <br>
            <div style=""width:100%; background-color:#3969AD"">
               <div style=""width:100%; font-size:20px; color: #FFFFFF"">Labrun Assignment Details</div>
            </div>
            <br>"        );

            var assignments = labRunDetailedStatus.AssignmentStatus;

            foreach (AssignmentStatusInfo info in assignments)
            {
                Console.WriteLine("Assignment Id:                " + info.AssignmentId.ToString());
                Console.WriteLine("Assignment Test Name:         " + info.TestName);
                Console.WriteLine("Assignment Status:            " + info.Status);
                Console.WriteLine("Assignment Execution Status:  " + info.ExecutionStatus);
                Console.WriteLine("Assignment Failure Reason:    " + info.FailureReason);
                Console.WriteLine("Assignment Error Detail:      " + info.ErrorDetail);
                Console.WriteLine("Assignment Log Detail Link:   " + "http://tfx/LabrunManager/AssignmentLog/Index?assignmentid=" + info.AssignmentId.ToString() + "&labrunid=" + LabrunId.ToString());
                Console.WriteLine();

                String ExecutionStatusColor;
                if (info.ExecutionStatus != "Pass")
                    ExecutionStatusColor = "color:#FF0000";
                else
                    ExecutionStatusColor = "color:#00FF00";

                sw.WriteLine("<br>\n" +
            "<table>\n" +
            "    <tr>\n" +
            "        <td>Assignment Id</td>\n" +
            "		 <td><a>" + info.AssignmentId.ToString() + "</a></td>\n" +
            "    </tr>\n" +
            "	 <tr>\n" +
            "        <td>Assignment Test Name</td>\n" +
            "        <td>" + info.TestName + "</td>\n" +
            "    </tr>\n" +
            "	 <tr>\n" +
            "        <td>Assignment Status</td>\n" +
            "        <td>" + info.Status + "</td>\n" +
            "    </tr>\n" +
            "	 <tr>\n" +
            "        <td>Assignment Execution Status</td>\n" +
            "        <td><a style= " + ExecutionStatusColor + ">" + info.ExecutionStatus + "</a>" + "</td>\n" +
            "    </tr>\n" +
            "	 <tr>\n" +
            "        <td>Assignment Failure Reason</td>\n" +
            "        <td><a style= color:#FF0000>\n" + info.FailureReason + "</a>" + "</td>\n" +
            "    </tr>\n" +
            "	 <tr>\n" +
            "        <td>Assignment Error Detail</td>\n" +
            "        <td><a style= color:#FF0000>" + info.ErrorDetail + "</a>" + "</td>\n" +
            "    </tr>\n" +
            "	 <tr>\n" +
            "        <td>Assignment Log Detail Link</td>\n" +
            "        <td><a href=\"http://tfx/LabrunManager/AssignmentLog/Index?assignmentid=" + info.AssignmentId.ToString() + "&labrunid=" + LabrunId.ToString() + "\">" + "click me to view the log" + "</a></td>\n" +
            "    </tr>\n" +
            "</table>\n");

            }
            sw.Flush();
            sw.Close();
            fs.Close();
            return labRunDetailedStatus;
        }
Exemplo n.º 2
0
        static void JenkinsStartLabRun(int labRunId)
        {
            var request = new StartLabRunRequest
            {
                LabRunId = labRunId
            };

            var client = new LabRunServiceClient();
            Console.WriteLine("Start labrun...");
            Console.WriteLine();
            client.StartLabRun(request);

            client.Close();
        }
Exemplo n.º 3
0
        static void RerunFailedAssignments(int labrunid)
        {
            var request = new RerunFailedAssignmentsRequest
            {
                LabRunId = labrunid
            };

            var client = new LabRunServiceClient();
            client.RerunFailedAssignments(request);

            // Always close the client.
            client.Close();
            Flag = true;
        }
Exemplo n.º 4
0
        static GetLabRunStatusResponse JenkinsGetLabRunStatus(int labRunId)
        {
            var request = new GetLabRunStatusRequest
            {
                LabRunId = labRunId
            };

            var client = new LabRunServiceClient();
            var labRunStatus = client.GetLabRunStatus(request);

            client.Close();
            return labRunStatus;
        }