Example #1
0
        public RunTests(
            bool demoMode,
            bool buildMode,
            bool offscreen,
            bool internet,
            bool showStatus,
            bool perftests,
            bool runsmallmoleculeversions,
            bool recordauditlogs,
            bool teamcityTestDecoration,
            bool retrydatadownloads,
            IEnumerable <string> pauseForms,
            int pauseSeconds      = 0,
            int pauseStartingPage = 1,
            bool useVendorReaders = true,
            int timeoutMultiplier = 1,
            string results        = null,
            StreamWriter log      = null,
            bool verbose          = false)
        {
            _buildMode  = buildMode;
            _log        = log;
            _process    = Process.GetCurrentProcess();
            _showStatus = showStatus;
            TestContext = new TestRunnerContext();
            SetTestDir(TestContext, results);

            // Set Skyline state for unit testing.
            Skyline = new InvokeSkyline();
            Skyline.Set("StressTest", true);
            Skyline.Set("FunctionalTest", true);
            Skyline.Set("SkylineOffscreen", !demoMode && offscreen);
            Skyline.Set("DemoMode", demoMode);
            Skyline.Set("NoVendorReaders", !useVendorReaders);
            Skyline.Set("NoSaveSettings", true);
            Skyline.Set("UnitTestTimeoutMultiplier", timeoutMultiplier);
            Skyline.Set("PauseSeconds", pauseSeconds);
            Skyline.Set("PauseStartingPage", pauseStartingPage);
            Skyline.Set("PauseForms", pauseForms != null ? pauseForms.ToList() : null);
            Skyline.Set("Log", (Action <string>)(s => Log(s)));
            Skyline.Run("Init");

            AccessInternet            = internet;
            RunPerfTests              = perftests;
            RetryDataDownloads        = retrydatadownloads;       // When true, try re-downloading data files on test failure, in case the failure is due to stale data
            RunsSmallMoleculeVersions = runsmallmoleculeversions; // Run the small molecule version of various tests?
            RecordAuditLogs           = recordauditlogs;          // Replace or create audit logs for tutorial tests
            LiveReports            = true;
            TeamCityTestDecoration = teamcityTestDecoration;
            Verbose = verbose;

            // Disable logging.
            LogManager.GetRepository().Threshold = LogManager.GetRepository().LevelMap["OFF"];
        }
Example #2
0
        public RunTests(
            bool demoMode,
            bool buildMode,
            bool offscreen,
            bool internet,
            bool showStatus,
            bool perftests,
            bool addsmallmoleculenodes,
            bool runsmallmoleculeversions,
            bool teamcityTestDecoration,
            IEnumerable <string> pauseForms,
            int pauseSeconds      = 0,
            bool useVendorReaders = true,
            int timeoutMultiplier = 1,
            string results        = null,
            StreamWriter log      = null)
        {
            _buildMode  = buildMode;
            _log        = log;
            _process    = Process.GetCurrentProcess();
            _showStatus = showStatus;
            TestContext = new TestRunnerContext();
            SetTestDir(TestContext, results);

            // Set Skyline state for unit testing.
            Skyline = new InvokeSkyline();
            Skyline.Set("StressTest", true);
            Skyline.Set("FunctionalTest", true);
            Skyline.Set("SkylineOffscreen", !demoMode && offscreen);
            Skyline.Set("DemoMode", demoMode);
            Skyline.Set("NoVendorReaders", !useVendorReaders);
            Skyline.Set("NoSaveSettings", true);
            Skyline.Set("UnitTestTimeoutMultiplier", timeoutMultiplier);
            Skyline.Set("PauseSeconds", pauseSeconds);
            Skyline.Set("PauseForms", pauseForms != null ? pauseForms.ToList() : null);
            Skyline.Set("Log", (Action <string>)(s => Log(s)));
            Skyline.Run("Init");

            AccessInternet            = internet;
            RunPerfTests              = perftests;
            AddSmallMoleculeNodes     = addsmallmoleculenodes;    // Add the magic small molecule test node to all documents?
            RunsSmallMoleculeVersions = runsmallmoleculeversions; // Run the small molecule version of various tests?
            LiveReports            = true;
            TeamCityTestDecoration = teamcityTestDecoration;

            // Disable logging.
            LogManager.GetRepository().Threshold = LogManager.GetRepository().LevelMap["OFF"];
        }
Example #3
0
        public RunTests(
            bool demoMode,
            bool buildMode,
            bool offscreen,
            bool internet,
            bool showStatus,
            bool perftests,
            bool addsmallmoleculenodes,
            bool runsmallmoleculeversions,
            IEnumerable <string> pauseForms,
            int pauseSeconds      = 0,
            bool useVendorReaders = true,
            int timeoutMultiplier = 1,
            string results        = null,
            StreamWriter log      = null)
        {
            _buildMode  = buildMode;
            _log        = log;
            _process    = Process.GetCurrentProcess();
            _showStatus = showStatus;
            TestContext = new TestRunnerContext();
            SetTestDir(TestContext, results);

            // Set Skyline state for unit testing.
            Skyline = new InvokeSkyline();
            Skyline.Set("StressTest", true);
            Skyline.Set("FunctionalTest", true);
            Skyline.Set("SkylineOffscreen", !demoMode && offscreen);
            Skyline.Set("DemoMode", demoMode);
            Skyline.Set("NoVendorReaders", !useVendorReaders);
            Skyline.Set("NoSaveSettings", true);
            Skyline.Set("UnitTestTimeoutMultiplier", timeoutMultiplier);
            Skyline.Set("PauseSeconds", pauseSeconds);
            Skyline.Set("PauseForms", pauseForms != null ? pauseForms.ToList() : null);
            try
            {
                Skyline.Get <string>("Name");
            }
            catch (Exception getNameException)
            {
                // ReSharper disable NonLocalizedString
                StringBuilder message = new StringBuilder();
                message.AppendLine("Error initializing settings");
                var exeConfig =
                    System.Configuration.ConfigurationManager.OpenExeConfiguration(
                        System.Configuration.ConfigurationUserLevel.None);
                message.AppendLine("Exe Config:" + exeConfig.FilePath);
                var localConfig =
                    System.Configuration.ConfigurationManager.OpenExeConfiguration(
                        System.Configuration.ConfigurationUserLevel.PerUserRoamingAndLocal);
                message.AppendLine("Local Config:" + localConfig.FilePath);
                var roamingConfig =
                    System.Configuration.ConfigurationManager.OpenExeConfiguration(
                        System.Configuration.ConfigurationUserLevel.PerUserRoaming);
                message.AppendLine("Roaming Config:" + roamingConfig.FilePath);
                throw new Exception(message.ToString(), getNameException);
                // ReSharper restore NonLocalizedString
            }
            Skyline.Run("Init");

            AccessInternet            = internet;
            RunPerfTests              = perftests;
            AddSmallMoleculeNodes     = addsmallmoleculenodes;    // Add the magic small molecule test node to all documents?
            RunsSmallMoleculeVersions = runsmallmoleculeversions; // Run the small molecule version of various tests?
            LiveReports = true;

            // Disable logging.
            LogManager.GetRepository().Threshold = LogManager.GetRepository().LevelMap["OFF"];
        }