public int Execute(Dictionary <string, string> argsLc, Dictionary <string, string> argsCased)
        {
            var testTitleData   = TestTitleDataLoader.Load(argsLc);
            var buildIdentifier = JenkinsConsoleUtility.GetArgVar(argsLc, "buildidentifier");
            var workspacePath   = JenkinsConsoleUtility.GetArgVar(argsLc, "workspacePath", Environment.GetEnvironmentVariable("TEMP"));
            var timeout         = TimeSpan.FromSeconds(int.Parse(JenkinsConsoleUtility.GetArgVar(argsLc, "timeout", "30")));

            verbose     = bool.Parse(JenkinsConsoleUtility.GetArgVar(argsLc, "verbose", "false"));
            _getRequest = new CsGetRequest {
                customId = buildIdentifier
            };

            JcuUtil.FancyWriteToConsole(ConsoleColor.Gray, "Begin CloudScriptListener");
            var returnCode = Login(testTitleData.titleId, buildIdentifier, testTitleData);

            if (returnCode != 0)
            {
                return(returnCode);
            }
            returnCode = WaitForTestResult(timeout, testTitleData);
            if (returnCode != 0)
            {
                return(returnCode);
            }
            JcuUtil.FancyWriteToConsole(ConsoleColor.Gray, "Test data found");
            returnCode = FetchTestResult(buildIdentifier, workspacePath, testTitleData);
            if (returnCode != 0)
            {
                return(returnCode);
            }
            JcuUtil.FancyWriteToConsole(ConsoleColor.Green, "Test data received");

            return(0);
        }
Beispiel #2
0
        public override void SetUp(UUnitTestContext testContext)
        {
            testTitleData           = TestTitleDataLoader.Load(null);
            PlayFabSettings.TitleId = testTitleData.titleId;

            var task = PlayFabClientAPI.LoginWithCustomIDAsync(new LoginWithCustomIDRequest {
                CreateAccount = true, CustomId = TEST_CUSTOM_ID, TitleId = testTitleData.titleId
            });

            task.Wait();

            testContext.True(PlayFabClientAPI.IsClientLoggedIn(), "User login not successful: " + PlayFabUtil.GetErrorReport(task.Result.Error));
        }
Beispiel #3
0
        public override void SetUp(UUnitTestContext testContext)
        {
            testTitleData = TestTitleDataLoader.Load(null);
            PlayFabSettings.staticSettings.TitleId = testTitleData.titleId;

            var task = clientApi.LoginWithCustomIDAsync(new LoginWithCustomIDRequest {
                CreateAccount = true, CustomId = TEST_CUSTOM_ID, TitleId = testTitleData.titleId
            });

            task.Wait();

            if (task.Result.Error != null)
            {
                testContext.True(clientApi.IsClientLoggedIn(), "User login not successful: " + task.Result.Error.GenerateErrorReport());
            }
        }
Beispiel #4
0
        public int Execute(Dictionary <string, string> argsLc, Dictionary <string, string> argsCased)
        {
            var testTitleData = TestTitleDataLoader.Load(null);

            UUnitIncrementalTestRunner.Start(false, null, testTitleData, null);
            // TODO: UUnitIncrementalTestRunner.AddAssembly();

            while (!UUnitIncrementalTestRunner.SuiteFinished)
            {
                UUnitIncrementalTestRunner.Tick();
            }

            var summaryLines = UUnitIncrementalTestRunner.Summary.Split('\n');

            foreach (var eachLine in summaryLines)
            {
                ConsoleColor color = eachLine.Contains("FAILED") ? ConsoleColor.Red : eachLine.Contains("PASSED") ? ConsoleColor.White : ConsoleColor.Yellow;
                JcuUtil.FancyWriteToConsole(color, eachLine);
            }
            Console.WriteLine();
            return(UUnitIncrementalTestRunner.AllTestsPassed ? 0 : 1);
        }
Beispiel #5
0
        private int LoginToPlayfab(Dictionary <string, string> argsLc)
        {
            // Get Login Credentials
            var testTitleData = TestTitleDataLoader.Load(argsLc);

            if (testTitleData == null)
            {
                return(1);
            }

            settings.TitleId            = testTitleData.titleId;
            settings.DeveloperSecretKey = testTitleData.developerSecretKey;

            // Perform PlayFab Login
            for (int i = 0; i < RETRY_COUNT; i++)
            {
                var tokenTask = authApi.GetEntityTokenAsync(null);
                tokenTask.Wait();

                if (string.IsNullOrEmpty(context.EntityToken))
                {
                    JcuUtil.FancyWriteToConsole(ConsoleColor.Red, "ERROR: CheckBblStandby was not able to authenticate as expected, sleeping...");
                    Thread.Sleep((int)RETRY_DELAY_SEC.TotalMilliseconds);
                }
                else
                {
                    break;
                }
            }

            if (string.IsNullOrEmpty(context.EntityToken))
            {
                JcuUtil.FancyWriteToConsole(ConsoleColor.Red, "ERROR: CheckBblStandby was not able to authenticate as expected. Failing out.");
                return(1);
            }

            return(0);
        }