예제 #1
0
        internal static string GetPipEnvironmentMissReport(
            ConcurrentDictionary <string, DependencySummary <string> > environmentSummary,
            ConcurrentDictionary <string, DependencySummary <string> > otherEnvironmentSummary)
        {
            var environmentCompare = SummaryAnalyzer.GenerateEnvironmentDifference(environmentSummary, otherEnvironmentSummary);

            if (environmentCompare.enviromentChanges.Count == 0 && environmentCompare.enviromentMissing.Count == 0)
            {
                return(string.Empty);
            }

            using (var output = new StringWriter(CultureInfo.InvariantCulture))
            {
                output.WriteLine("\n   Environment Changes:");
                foreach (var values in environmentCompare.enviromentChanges)
                {
                    output.WriteLine("Environment variable ({0} pips): {1} = {2} <> {3}", values[1], values[0], values[2], values[3]);
                }

                if (environmentCompare.Item2.Count > 0)
                {
                    output.WriteLine("Current log missing following environmet variables:");
                    foreach (var values in environmentCompare.Item2)
                    {
                        output.WriteLine("Variable ({0} pips): {1} = {2}", values[1], values[0], values[3]);
                    }
                }

                return(output.ToString());
            }
        }
예제 #2
0
        private string CompareEnvironmentSummary(ConcurrentDictionary <string, DependencySummary <string> > otherEnvironmentSummary)
        {
            var environmentCompare = SummaryAnalyzer.GenerateEnvironmentDifference(m_analyzer.Summary.EnvironmentSummary, otherEnvironmentSummary);

            if (environmentCompare.enviromentChanges.Count == 0 && environmentCompare.enviromentMissing.Count == 0)
            {
                return("Environments are identical.");
            }

            using (var output = new StringWriter(CultureInfo.InvariantCulture))
            {
                // Now compare
                output.WriteLine("List differences in distinct EnvironmentVariableName = value; pairs");
                output.WriteLine("defined in process pips between execution log current and previous.");
                output.WriteLine("=====================================================================");
                foreach (var values in environmentCompare.enviromentChanges)
                {
                    output.WriteLine("Environment variable ({0} pips): {1} = {2} <> {3}", values[1], values[0], values[2], values[3]);
                }

                if (environmentCompare.Item2.Count > 0)
                {
                    output.WriteLine("Current log missing following environmet variables:");
                    foreach (var values in environmentCompare.Item2)
                    {
                        output.WriteLine("Variable ({0} pips): {1} = {2}", values[1], values[0], values[3]);
                    }
                }

                return(output.ToString());
            }
        }