Ejemplo n.º 1
0
        //function to perform operations after receiving builds
        public static void AcceptBuild()
        {
            var directories = System.IO.Directory.GetDirectories(ServiceEnvironment.fileStorage);

            foreach (string dir in directories)
            {
                var subdirectories = System.IO.Directory.GetDirectories(dir);
                foreach (string subdirectory in subdirectories)
                {
                    string[] buildFiles = System.IO.Directory.GetFiles(subdirectory);
                    foreach (string file in buildFiles)
                    {
                        if (System.IO.File.Exists(System.IO.Path.Combine(buildPath, System.IO.Path.GetFileName(file))))
                        {
                            try
                            {
                                System.IO.File.Delete(System.IO.Path.Combine(buildPath, System.IO.Path.GetFileName(file)));
                            }
                            catch (Exception ex) { ex.ToString(); }
                        }
                        try
                        {
                            System.IO.File.Move(file, System.IO.Path.Combine(buildPath, System.IO.Path.GetFileName(file)));
                        }
                        catch (Exception ex)
                        {
                            ex.ToString();
                        }
                        string[] buildFiles1 = System.IO.Directory.GetFiles(subdirectory);
                        if (buildFiles1.Length == 0)
                        {
                            System.IO.Directory.Delete(subdirectory);
                        }
                        var subdirectories1 = System.IO.Directory.GetDirectories(dir);
                        if (subdirectories1.Length == 0)
                        {
                            System.IO.Directory.Delete(dir);
                        }
                        LogFileName = System.IO.Path.GetFileNameWithoutExtension(file);
                        DllLoaderExec.UpdateDllLoader(buildPath, System.IO.Path.GetFileNameWithoutExtension(file));
                        DllLoaderExec.InitiateTest();
                        SendMsgtoRepo(LogFileName);
                    }
                }
            }
        }
        public static void load(string j)
        {
            Thread.Sleep(2000);
            string testpath = "../../../ThFileStore" + "/" + j + "TR.xml";

            Console.WriteLine(testpath);
            try
            {
                parse("lib", testpath);
            }
            catch {
                Console.WriteLine("invalid test request or no lib");
            }
            string fileStorage = "../../../ThFileStore";

            DllLoaderExec.UpdateDllLoader(fileStorage, j, values.ToArray());
            DllLoaderExec.InitiateTest();
            sendtestlogs_conn(j);
        }