Ejemplo n.º 1
0
        public void AwaitTestResults_SucceedsWithPassingTests_UnitTest()
        {
            mockClient.mockTestResults.allPass = true;

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

            Assert.True(results.allPass);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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;
     }
 }
        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)}");
            }
        }
Ejemplo n.º 6
0
        public void AwaitTestResults_ErrorsWithFailingTests_UnitTest()
        {
            mockClient.mockTestResults.allPass = false;

            Assert.Throws <Exception>(() => CloudTestBuilder.AwaitTestResults("fakeJobId", testAccessToken, testProjectId));
        }
Ejemplo n.º 7
0
        public void ParseCommandLineArgs_ErrorsWithInvalidPlatform_UnitTest()
        {
            string[] testArgs = { "-testPlatform", "FakePlatform" };

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