public void AwaitTestResults_SucceedsWithPassingTests_UnitTest() { mockClient.mockTestResults.allPass = true; var results = CloudTestBuilder.AwaitTestResults("fakeJobId", testAccessToken, testProjectId); Assert.True(results.allPass); }
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); }
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); }
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)}"); } }
public void AwaitTestResults_ErrorsWithFailingTests_UnitTest() { mockClient.mockTestResults.allPass = false; Assert.Throws <Exception>(() => CloudTestBuilder.AwaitTestResults("fakeJobId", testAccessToken, testProjectId)); }
public void ParseCommandLineArgs_ErrorsWithInvalidPlatform_UnitTest() { string[] testArgs = { "-testPlatform", "FakePlatform" }; Assert.Throws <Exception>(() => CloudTestBuilder.ParseCommandLineArgs(testArgs)); }