public async Task Test01_SequencerPreRunSetupTest() { AutomationSequencer sequencer = new AutomationSequencer() { AutomationRunnerSettings = this.AutomationRunnerSettings, CancellationToken = nullToken, DatabaseAutomationRunner = null, DatabaseManager = null }; Assert.IsTrue(await sequencer.LoadBranchesListAsync()); Assert.IsTrue(await sequencer.LoadRootDocumentAsync()); Assert.IsTrue(sequencer.ParseRootDocumentAsync()); }
public async Task Test01_GetAutomationRepoBranchesTest() { AutomationSequencer sequencer = new AutomationSequencer() { AutomationRunnerSettings = this.AutomationRunnerSettings, AutomationRunMode = AutomationRunMode.Interactive, WoTClientVersion = "TODO", WoTModpackOnlineFolderVersion = "TODO" }; throw new BadMemeException("you should, like, finish this"); /* * //TODO: dynamically get this from the beta db? * ApplicationSettings.WoTModpackOnlineFolderVersion = "1.10.0"; * ApplicationSettings.WoTClientVersion = "1.10.0.4"; */ await sequencer.LoadBranchesListAsync(); await sequencer.LoadRootDocumentAsync(); await sequencer.LoadGlobalMacrosAsync(); List <DatabasePackage> DatabasePackages = new List <DatabasePackage>(); DatabasePackages.Add(new SelectablePackage() { UID = "123456789ABCD", PackageName = "Some_rofl_op_russian_medium", ParentCategory = new Category() { Name = "Cat_name" }, Level = 0 }); bool loadAutomationSequencesResult = await sequencer.LoadAutomationSequencesAsync(DatabasePackages); bool parseAutomationSequencesResult = sequencer.ParseAutomationSequences(); bool runSequencesResult = await sequencer.RunSequencesAsync(); //Assert.IsFalse(string.IsNullOrEmpty(LatestSupportedWoTVersion)); //Assert.IsFalse(string.IsNullOrEmpty(LatestSupportedWoTVersion)); }
public async Task Test01_GetAutomationRepoBranchesTest() { AutomationSequencer sequencer = new AutomationSequencer() { AutomationRunnerSettings = new AutomationRunnerSettings() { SelectedBranch = "master" // is default } }; await sequencer.LoadBranchesListAsync(); await sequencer.LoadRootDocumentAsync(); await sequencer.LoadGlobalMacrosAsync(); //Assert.IsFalse(string.IsNullOrEmpty(LatestSupportedWoTVersion)); //Assert.IsFalse(string.IsNullOrEmpty(LatestSupportedWoTVersion)); }
private async Task LoadAutomationSequencerAsync() { if (!AutomationSettings.UseLocalRunnerDatabase) { //load branches from the server Logging.Info("Loading branches"); await AutomationSequencer.LoadBranchesListAsync(); //ensure that the branch specified in settings exists, and if so apply it. else apply the default setting if (!AutomationSequencer.AutomationBranches.Contains(AutomationSettings.SelectedBranch)) { Logging.Error("The selected branch does not exist on the server: {0}", AutomationSettings.SelectedBranch); MessageBox.Show(string.Format("The selected branch {0} does not exist on the server, setting to default", AutomationSettings.SelectedBranch)); AutomationSettings.SelectedBranch = AutomationSequencer.AutomationRepoDefaultBranch; AutomamtionDatabaseSelectedBranchSetting.Text = AutomationSequencer.AutomationRepoDefaultBranch; //TODO: command line mode should be an exit return } else { Logging.Info("Applying branch to load from: {0}", AutomationSettings.SelectedBranch); } } //load the available package sequences from the root document SequencesAvailableListBox.Items.Clear(); SequencesToRunListBox.Items.Clear(); SequencesAvailableListBox.Items.Add("Loading available sequences from database..."); Logging.Info("Loading sequences from root document"); await AutomationSequencer.LoadRootDocumentAsync(); //parse the document now that it's loaded Logging.Info("Parsing sequences from root document"); AutomationSequencer.ParseRootDocumentAsync(); //load the sequences into the listbox view SequencesAvailableListBox.Items.Clear(); foreach (AutomationSequence sequence in AutomationSequencer.AutomationSequences) { SequencesAvailableListBox.Items.Add(sequence); } }