コード例 #1
0
 public void OnPostprocessBuild(BuildReport report)
 {
     if ((report.summary.options & BuildOptions.IncludeTestAssemblies) != 0)
     {
         RecordedPlaybackEditorUtils.ClearCreatedPaths();
     }
 }
コード例 #2
0
        static async void ClearFilesOnBuildCompletion(BuildReport report)
        {
            while (report.summary.result == BuildResult.Unknown)
            {
                await Task.Delay(1000);
            }

            RecordedPlaybackEditorUtils.ClearCreatedPaths();
        }
コード例 #3
0
        public static void UploadRecording(string recordingName, string filePath)
        {
            var projectId = Application.cloudProjectId;
            var url       = $"{AutomatedQARuntimeSettings.GAMESIM_API_ENDPOINT}/v1/recordings?projectId={projectId}";

            Debug.Log($"Uploading file {filePath} as {recordingName}");

            // if composite recording, combine touchData for all referenced recordings
            try
            {
                var targetFilePath = FormatRecording(recordingName, filePath);
                Transaction.Upload(url, recordingName, targetFilePath);
            }
            finally
            {
                RecordedPlaybackEditorUtils.ClearCreatedPaths();
            }
        }
コード例 #4
0
        public void OnPreprocessBuild(BuildReport report)
        {
            if ((report.summary.options & BuildOptions.IncludeTestAssemblies) != 0)
            {
                RecordedPlaybackEditorUtils.CreateDirectoryIfNotExists(resourcesPath);

                foreach (var testdata in RecordedTesting.RecordedTesting.GetAllRecordedTests())
                {
                    string sourceFromEditor = Path.Combine(Application.dataPath, testdata.recording);
                    string destInResources  = Path.Combine(resourcesPath, testdata.recording);

                    if (File.Exists(sourceFromEditor))
                    {
                        RecordedPlaybackEditorUtils.CreateDirectoryIfNotExists(Path.GetDirectoryName(destInResources));
                        RecordedPlaybackEditorUtils.MarkFilesAsCreated(RecordedPlaybackPersistentData.CopyRecordingFile(sourceFromEditor, destInResources));
                    }
                    else
                    {
                        Debug.LogError($"file {sourceFromEditor} doesn't exist");
                    }
                }

                var runs = AssetDatabase.FindAssets("t:AutomatedRun");
                foreach (var runGuid in runs)
                {
                    string runPath          = AssetDatabase.GUIDToAssetPath(runGuid);
                    string sourceFromEditor = Path.Combine(runPath);
                    string destInResources  = Path.Combine(resourcesPath, "AutomatedRuns", Path.GetFileName(runPath));

                    if (File.Exists(sourceFromEditor))
                    {
                        RecordedPlaybackEditorUtils.CreateDirectoryIfNotExists(Path.GetDirectoryName(destInResources));
                        File.Copy(sourceFromEditor, destInResources);
                        RecordedPlaybackEditorUtils.MarkFileAsCreated(destInResources);
                        Debug.Log($"Copied AutomatedRun file from {sourceFromEditor} to {destInResources}");
                    }
                    else
                    {
                        Debug.LogError($"file {sourceFromEditor} doesn't exist");
                    }
                }
            }
            ClearFilesOnBuildCompletion(report);
        }
コード例 #5
0
        private static string FormatRecording(string recordingName, string filePath)
        {
            var currRecording = RecordingInputModule.InputModuleRecordingData.FromFile(filePath);

            if (currRecording.recordings.Count > 0)
            {
                // create temporary file that copies original
                Debug.Log($"extractRecordingsFromComposite: {recordingName} {filePath}");
                var tempFilePath = $"{AutomatedQARuntimeSettings.RecordingFolderNameWithAssetPath}/Temp/{recordingName}";
                var segmentDir   = Path.GetDirectoryName(filePath) ?? "";
                currRecording.touchData = currRecording.GetAllTouchData(segmentDir: segmentDir);
                currRecording.recordings.Clear();
                RecordedPlaybackEditorUtils.CreateDirectoryIfNotExists(Path.GetDirectoryName(tempFilePath));
                currRecording.SaveToFile(tempFilePath);
                RecordedPlaybackEditorUtils.MarkFileAsCreated(tempFilePath);

                return(tempFilePath);
            }

            return(filePath);
        }