Example #1
0
        public void CreateCondorFile()
        {
            //gets all tests config for this test
            var allTestsConfigs = TestingUtil.GenerateAllTestsConfigs(this.TestsConfig);

            //gets all arguments for each tests config
            var testArgumentsList = allTestsConfigs.Select(testsConfig => ArgumentsParser.GetArgs(testsConfig)).ToList();

            //create as many condor submit files as necessary
            var scriptFilePath = Path.GetFullPath($"{this.TestsConfig.CondorScriptPath}");
            var executableFile = Assembly.GetEntryAssembly().GetName().Name.Split('.').Last();
            var fileNum        = 0;

            for (var i = 0; i < testArgumentsList.Count; i += this.MaxJobsPerFile, fileNum++)
            {
                var numTests = ((i + this.MaxJobsPerFile) > testArgumentsList.Count
                    ? testArgumentsList.Count - i
                    : this.MaxJobsPerFile);

                this.CreateCondorFile(scriptFilePath + fileNum, executableFile, testArgumentsList.GetRange(i, numTests));
            }
        }