コード例 #1
0
        public void AwaitTestResults_SucceedsWithPassingTests_UnitTest()
        {
            mockClient.mockTestResults.allPass = true;

            var results = CloudTestBuilder.AwaitTestResults("fakeJobId", testAccessToken, testProjectId);

            Assert.True(results.allPass);
        }
コード例 #2
0
        public void ParseCommandLineArgs_SucceedsWithEquals_UnitTest()
        {
            string[] testArgs = { $"-token={testAccessToken}", $"-outputDir={testOutputDir}", $"-testPlatform={testPlatform}", $"-projectId={testProjectId}" };

            var commandLineArgs = CloudTestBuilder.ParseCommandLineArgs(testArgs);

            Assert.AreEqual(commandLineArgs.AccessToken, testAccessToken);
            Assert.AreEqual(commandLineArgs.TargetPlatform, testPlatform);
            Assert.AreEqual(CloudTestConfig.BuildFolder, testOutputDir);
        }
コード例 #3
0
        public void ParseCommandLineArgs_SucceedsWithSeparateArgs_UnitTest()
        {
            string[] testArgs = { "-token", testAccessToken, "-outputDir", testOutputDir, "-testPlatform", testPlatform.ToString(), "-projectId", testProjectId };

            var commandLineArgs = CloudTestBuilder.ParseCommandLineArgs(testArgs);

            Assert.AreEqual(commandLineArgs.AccessToken, testAccessToken);
            Assert.AreEqual(commandLineArgs.TargetPlatform, testPlatform);
            Assert.AreEqual(CloudTestConfig.BuildFolder, testOutputDir);
        }
コード例 #4
0
 private void Update()
 {
     if (createBuild && !EditorApplication.isCompiling)
     {
         createBuild = false;
         PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.iOS, PlayerSettings.GetScriptingDefineSymbolsForGroup(BuildTargetGroup.iOS));
         _bundleUpload.buildName = $"CloudBundle{CloudTestConfig.BuildFileExtension}";
         _bundleUpload.buildPath = CloudTestConfig.BuildPath;
         CloudTestBuilder.CreateBuild(buildTarget);
         CloudTestPipeline.testBuildFinished += OnBuildFinish;
     }
 }
コード例 #5
0
        public static void PostExport(string exportPath)
        {
            var authToken = Environment.GetEnvironmentVariable("AUTH_TOKEN");
            var projectId = Environment.GetEnvironmentVariable("PROJECT_ID");

            Debug.Log("CloudBuildPostExport: Build started");
            try
            {
                if (string.IsNullOrEmpty(projectId))
                {
                    projectId = Application.cloudProjectId;
                }
                CloudTestBuilder.BuildAndRunTests(BuildTarget.Android, authToken, projectId);
            }
            finally
            {
                Debug.Log($"CloudBuildPostExport: Build completed - {CloudTestConfig.BuildPath} {File.Exists(CloudTestConfig.BuildPath)}");
            }
        }
コード例 #6
0
        public void AwaitTestResults_ErrorsWithFailingTests_UnitTest()
        {
            mockClient.mockTestResults.allPass = false;

            Assert.Throws <Exception>(() => CloudTestBuilder.AwaitTestResults("fakeJobId", testAccessToken, testProjectId));
        }
コード例 #7
0
        public void ParseCommandLineArgs_ErrorsWithInvalidPlatform_UnitTest()
        {
            string[] testArgs = { "-testPlatform", "FakePlatform" };

            Assert.Throws <Exception>(() => CloudTestBuilder.ParseCommandLineArgs(testArgs));
        }