public override void TickTest()
        {
            // create a new build
            UnrealBuildSource Build = new UnrealBuildSource(this.ProjectName, this.ProjectFile, this.UnrealPath, this.UsesSharedBuildType, this.BuildPath, new string[] { "" });

            // check it's valid
            if (!CheckResult(Build.BuildCount > 0, "staged build was invalid"))
            {
                MarkComplete();
                return;
            }

            // Create devices to run the client and server
            ITargetDevice PCDevice = new TargetDeviceMac("LocalMac", Globals.TempDir);

            UnrealOptions GameOptions = new UnrealOptions();

            GameOptions.Windowed   = true;
            GameOptions.ResX       = 1280;
            GameOptions.ResY       = 720;
            GameOptions.CommonArgs = "-log";

            UnrealOptions OtherOptions = new UnrealOptions();

            OtherOptions.CommonArgs = "-log";

            // editor configs
            TestInstallThenRun(Build, UnrealTargetRole.EditorGame, PCDevice, UnrealTargetConfiguration.Development, GameOptions);
            TestInstallThenRun(Build, UnrealTargetRole.EditorServer, PCDevice, UnrealTargetConfiguration.Development, OtherOptions);
            TestInstallThenRun(Build, UnrealTargetRole.Editor, PCDevice, UnrealTargetConfiguration.Development, OtherOptions);

            // Monolithic clients
            //TestInstallThenRun(Build, UnrealRoleType.Client, PCDevice, UnrealTargetConfiguration.Development, GameOptions);
            TestInstallThenRun(Build, UnrealTargetRole.Client, PCDevice, UnrealTargetConfiguration.Test, GameOptions);

            // Monolithic servers
            //TestInstallThenRun(Build, UnrealRoleType.Server, PCDevice, UnrealTargetConfiguration.Development, OtherOptions);
            //TestInstallThenRun(Build, UnrealRoleType.Server, PCDevice, UnrealTargetConfiguration.Test, OtherOptions);

            MarkComplete();
        }
Beispiel #2
0
        public override void TickTest()
        {
            // Grab the most recent Release build of Orion
            UnrealBuildSource Build = new UnrealBuildSource(this.ProjectName, this.ProjectFile, this.UnrealPath, this.UsesSharedBuildType, this.BuildPath);

            // create client and server riles
            UnrealSessionRole ClientRole = new UnrealSessionRole(UnrealTargetRole.Client, UnrealTargetPlatform.Win64, UnrealTargetConfiguration.Development);
            UnrealSessionRole ServerRole = new UnrealSessionRole(UnrealTargetRole.Server, UnrealTargetPlatform.Win64, UnrealTargetConfiguration.Development);

            // create configurations from the build
            UnrealAppConfig ClientConfig = Build.CreateConfiguration(ClientRole);
            UnrealAppConfig ServerConfig = Build.CreateConfiguration(ServerRole);

            UnrealOptions Options = new UnrealOptions();

            // create some params
            string[] Params = new string[] { "nullrhi", "ResX=800", "ResY=600", "Map=FooMap", "epicapp=Prod", "buildidoverride=1111", "commonargs=-somethingcommon", "-clientargs=-somethingclient", "-serverargs=-somethingserver" };

            // apply them to options
            AutoParam.ApplyParams(Options, Params);

            Options.ApplyToConfig(ClientConfig);
            Options.ApplyToConfig(ServerConfig);

            CheckResult(ClientConfig.CommandLine.Contains("-nullrhi"), "Client Arg not applied!");
            CheckResult(ClientConfig.CommandLine.Contains("-ResX=800"), "Client Arg not applied!");
            CheckResult(ClientConfig.CommandLine.Contains("-ResY=600"), "Client Arg not applied!");
            CheckResult(ClientConfig.CommandLine.Contains("-somethingclient"), "Client Arg not applied!");

            CheckResult(ServerConfig.CommandLine.Contains("-Map=FooMap") == false, "Server Arg incorrectly applied!");
            CheckResult(ServerConfig.CommandLine.StartsWith("FooMap"), "Server Args not start with map!");
            CheckResult(ServerConfig.CommandLine.Contains("-somethingserver"), "Server Arg not applied!");

            CheckResult(ClientConfig.CommandLine.Contains("-buildidoverride=1111"), "Common Arg not applied!");
            CheckResult(ClientConfig.CommandLine.Contains("-somethingcommon"), "Common Arg not applied!");
            CheckResult(ServerConfig.CommandLine.Contains("-buildidoverride=1111"), "Common Arg not applied!");
            CheckResult(ServerConfig.CommandLine.Contains("-somethingcommon"), "Common Arg not applied!");

            MarkComplete();
        }
Beispiel #3
0
        public override void TickTest()
        {
            AccountPool.Instance.RegisterAccount(new EpicAccount("Foo", "Bar"));

            // Add three devices to the pool
            DevicePool.Instance.RegisterDevices(new ITargetDevice[] {
                new TargetDeviceWindows("Local PC1", Globals.TempDir)
                , new TargetDeviceWindows("Local PC2", Globals.TempDir)
            });

            // Create a new build (params come from our base class will be similar to "OrionGame" and "p:\builds\orion\branch-cl")
            UnrealBuildSource Build = new UnrealBuildSource(this.GameName, this.UsesSharedBuildType, Environment.CurrentDirectory, this.BuildPath, new string[] { "" });

            // create a new options structure
            UnrealOptions Options = new UnrealOptions();

            // set the mapname, this will be applied automatically to the server
            Options.Map = "OrionEntry";
            Options.Log = true;

            // add some common options.
            string ServerArgs = " -nomcp -log";

            // We want the client to connect to the server, so get the IP address of this PC and add it to the client args as an ExecCmd
            string LocalIP    = Dns.GetHostEntry(Dns.GetHostName()).AddressList.Where(o => o.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork).First().ToString();
            string ClientArgs = string.Format(" -ExecCmds=\"open {0}\"", LocalIP);

            // create a new session with client & server roles
            UnrealSession Session = new UnrealSession(Build, new[] {
                new UnrealSessionRole(UnrealTargetRole.Client, UnrealTargetPlatform.PS4, UnrealTargetConfiguration.Development, ClientArgs, Options)
                , new UnrealSessionRole(UnrealTargetRole.Server, UnrealTargetPlatform.Win64, UnrealTargetConfiguration.Development, ServerArgs, Options)
            });

            // launch an instance of this session
            UnrealSessionInstance SessionInstance = Session.LaunchSession();

            // wait for two minutes - long enough for anything to go wrong :)
            DateTime StartTime = DateTime.Now;

            while (SessionInstance.ClientsRunning && SessionInstance.ServerRunning)
            {
                if ((DateTime.Now - StartTime).TotalSeconds > 120)
                {
                    break;
                }

                Thread.Sleep(1000);
            }

            // check these are both still running
            CheckResult(SessionInstance.ClientsRunning, "Clients exited during test");
            CheckResult(SessionInstance.ServerRunning, "Server exited during test");

            // shutdown the session
            SessionInstance.Shutdown();

            // shutdown the pools
            AccountPool.Shutdown();
            DevicePool.Shutdown();

            MarkComplete(TestResult.Passed);
        }
Beispiel #4
0
        protected void TestInstallThenRun(UnrealBuildSource Build, UnrealTargetRole ProcessType, ITargetDevice Device, UnrealTargetConfiguration Config, UnrealOptions InOptions = null)
        {
            // create a config based on the passed in params

            UnrealSessionRole Role = new UnrealSessionRole(ProcessType, Device.Platform, Config, InOptions);

            Log.Info("Testing {0}", Role);

            UnrealAppConfig AppConfig = Build.CreateConfiguration(Role);

            if (!CheckResult(AppConfig != null, "Could not create config for {0} {1} with platform {2} from build.", Config, ProcessType, Device))
            {
                MarkComplete();
                return;
            }

            // Install the app on this device
            IAppInstall AppInstall = Device.InstallApplication(AppConfig);

            CheckResult(AppConfig != null, "Could not create AppInstall for {0} {1} with platform {2} from build.", Config, ProcessType, Device);


            DateTime StartTime = DateTime.Now;

            // Run the app and wait for either a timeout or it to exit
            IAppInstance AppProcess = AppInstall.Run();

            while (AppProcess.HasExited == false)
            {
                if ((DateTime.Now - StartTime).TotalSeconds > 60)
                {
                    break;
                }

                Thread.Sleep(1000);
            }

            // Check it didn't exit unexpectedly
            CheckResult(AppProcess.HasExited == false, "Failed to run {0} {1} with platform {2}", Config, ProcessType, Device);

            // but kill it
            AppProcess.Kill();

            // Check that it left behind some artifacts (minimum should be a log)
            int ArtifactCount = new DirectoryInfo(AppProcess.ArtifactPath).GetFiles("*", SearchOption.AllDirectories).Length;

            CheckResult(ArtifactCount > 0, "No artifacts on device!");
        }