Exemplo n.º 1
0
        private void SendMail()
        {
                string emailFrom = "*****@*****.**";

                // Send results email                
                SendMail mail = new SendMail();
                mail.To = m_mailTo;
                if (!string.IsNullOrEmpty(m_buildNumber) && !string.IsNullOrEmpty(this.Branch)
                    && !string.IsNullOrEmpty(this.BuildFlavor))
                {
                    mail.Subject = "Test Results Rollup: " + this.BuildFlavor + " Build - "
                        + m_buildNumber + ", Branch - " + this.Branch;
                }
                else
                {
                    mail.Subject = "Test Results Rollup";
                }
                mail.From = emailFrom;
                mail.IsBodyHtml = true;
                StreamReader rd = new StreamReader(RunMFTests.ResultsPath + @"\" + m_resultsFile);
                mail.Body = rd.ReadToEnd();
                rd.Close();
                Console.WriteLine("Sending results email to: " + m_mailTo);
                Utils.WriteToEventLog(string.Format("TestSystem: Sending the results email to: {0}", m_mailTo));
                mail.Execute();
        }        
Exemplo n.º 2
0
        internal void SendMail()
        {
            string emailFrom = "*****@*****.**";

            // Send results email                
            SendMail mail = new SendMail();
            mail.To = "[email protected],[email protected]";            
            mail.Subject = string.Format("TEST TIMED OUT: Test {0} on machine {1} for build number {2} has timed out",
                m_test.Name, Environment.MachineName, TestSystem.BuildNumber);
            mail.From = emailFrom;
            mail.IsBodyHtml = true;
            string mailBody = string.Format(
                "On {0}, Test {1} for build number {2} has exceeded the {3} minute timeout rule for running the test. " +
                "<BR><BR>As a result the harness is {4}", Environment.MachineName, m_test.Name, TestSystem.BuildNumber,
                m_timeOut / 60000, "terminating executing the current test suite, and will continue.");

            if (m_halt != 0)
            {
                mailBody = string.Format(
                "On {0}, Test {1} for build number {2} has exceeded the {3} minute timeout rule for running the test. " +
                "<BR><BR>As a result the harness is {4}", Environment.MachineName, m_test.Name, TestSystem.BuildNumber,
                m_timeOut / 60000, "waiting for investigation. Tests will halt until manual action is taken.");
            }
            mail.Body = mailBody;
            Console.WriteLine("\tSending email..");
            mail.Execute();
        }