Esempio n. 1
0
        public void Run(CommandLineOptions options)
        {
            try
            {
                var arkade = new Core.Arkade();

                var fileInfo = new FileInfo(options.Archive);
                Log.Information($"Processing archive: {fileInfo.FullName}");

                if (!Enum.TryParse(options.ArchiveType, true, out ArchiveType archiveType))
                {
                    Log.Error("Unknown archive type");
                    throw new ArgumentException("unknown archive type");
                }

                TestSession testSession = CreateTestSession(options, arkade, archiveType);

                var archiveMetadata = JsonConvert.DeserializeObject <ArchiveMetadata>(File.ReadAllText(options.MetadataFile));

                testSession.ArchiveMetadata = archiveMetadata;

                arkade.CreatePackage(testSession, PackageType.SubmissionInformationPackage, options.OutputDirectory);

                arkade.SaveReport(testSession, PrepareTestReportFile(options, testSession));
            }
            finally
            {
                ArkadeProcessingArea.CleanUp();
            }
        }
Esempio n. 2
0
        private static TestSession CreateTestSession(CommandLineOptions options, Core.Arkade arkade, ArchiveType archiveType)
        {
            TestSession testSession;

            if (File.Exists(options.Archive))
            {
                Log.Debug("File exists");
                testSession = arkade.RunTests(ArchiveFile.Read(options.Archive, archiveType));
            }
            else if (Directory.Exists(options.Archive))
            {
                Log.Debug("Directory exists");
                testSession = arkade.RunTests(ArchiveDirectory.Read(options.Archive, archiveType));
            }
            else
            {
                throw new ArgumentException("Invalid archive path: " + options.Archive);
            }
            return(testSession);
        }