From 6afe993f128d8b7908a6573a8207877cbeb7f3ed Mon Sep 17 00:00:00 2001 From: Steffen Froehlich Date: Tue, 16 Apr 2024 13:23:38 -0700 Subject: [PATCH] release/2.1.1 --- Directory.Build.props | 2 +- .../Python.ExampleApplication.py | 8 ++++---- .../articles/troubleshooting/troubleshooting.md | 2 +- .../Unit/Engine/Manifest/MigrationManifestFactoryTests.cs | 4 +--- tests/Tableau.Migration.Tests/Unit/FilePathTests.cs | 8 +++++--- .../Tableau.Migration.Tests/Unit/StreamExtensionsTests.cs | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 32a8051..68edf20 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,7 +4,7 @@ enable true true - 2.1.0 + 2.1.1 Tableau Software, LLC Tableau Software, LLC Copyright (c) 2024, Tableau Software, LLC and its licensors diff --git a/examples/Python.ExampleApplication/Python.ExampleApplication.py b/examples/Python.ExampleApplication/Python.ExampleApplication.py index 01f820c..4850fe8 100644 --- a/examples/Python.ExampleApplication/Python.ExampleApplication.py +++ b/examples/Python.ExampleApplication/Python.ExampleApplication.py @@ -12,7 +12,7 @@ def migrate(): """Performs a migration using Tableau Migration SDK.""" - planBuilder = tableau_migration.MigrationPlanBuilder() + plan_builder = tableau_migration.MigrationPlanBuilder() migration = tableau_migration.Migrator() config = configparser.ConfigParser() @@ -37,11 +37,11 @@ def migrate(): # TODO: add filters, mappings, transformers, etc. here. # Validate the migration plan. - validation_result = planBuilder.validate() + validation_result = plan_builder.validate() # TODO: Handle errors if the validation fails here. - plan = planBuilder.build() + plan = plan_builder.build() # Run the migration. results = migration.execute(plan) @@ -55,7 +55,7 @@ def migrate(): # Create a thread that will run the migration and start it. migration_thread = Thread(target = migrate) - migration_thread.start(); + migration_thread.start() done = False # Create a busy-wait loop to continue checking if Ctrl+C was pressed to cancel the migration. diff --git a/src/Documentation/articles/troubleshooting/troubleshooting.md b/src/Documentation/articles/troubleshooting/troubleshooting.md index 82fa7a2..66a3a70 100644 --- a/src/Documentation/articles/troubleshooting/troubleshooting.md +++ b/src/Documentation/articles/troubleshooting/troubleshooting.md @@ -49,7 +49,7 @@ Python for type in ServerToCloudMigrationPipeline.ContentTypes: content_type = type.ContentType _logger.LogInformation(f"## {content_type.Name} ##") - for entry in result.Manifest.Entries.ForContentType(content_type): + for entry in result.manifest.entries.ForContentType(content_type): _logger.LogInformation(f"{content_type.Name} {entry.Source.Location} Migration Status: {entry.Status}") if entry.Errors: _logger.LogError(f"## {content_type.Name} Errors detected! ##") diff --git a/tests/Tableau.Migration.Tests/Unit/Engine/Manifest/MigrationManifestFactoryTests.cs b/tests/Tableau.Migration.Tests/Unit/Engine/Manifest/MigrationManifestFactoryTests.cs index 2d92d36..7aac8cd 100644 --- a/tests/Tableau.Migration.Tests/Unit/Engine/Manifest/MigrationManifestFactoryTests.cs +++ b/tests/Tableau.Migration.Tests/Unit/Engine/Manifest/MigrationManifestFactoryTests.cs @@ -97,9 +97,7 @@ public void CreatesInstancesWithoutInput() Assert.NotSame(manifest1, manifest2); } - //TODO (W-14313275): Previous manifest is not used - //until it can be fully tested/made working. - [Fact(Skip = "Previous manifest is not used until it can be fully tested/made working.")] + [Fact] public void CopiesFromPreviousManifest() { var previousEntries = CreateMany().ToImmutableArray(); diff --git a/tests/Tableau.Migration.Tests/Unit/FilePathTests.cs b/tests/Tableau.Migration.Tests/Unit/FilePathTests.cs index 95398fd..be3bc44 100644 --- a/tests/Tableau.Migration.Tests/Unit/FilePathTests.cs +++ b/tests/Tableau.Migration.Tests/Unit/FilePathTests.cs @@ -14,7 +14,6 @@ // limitations under the License. // -using System; using System.Collections.Immutable; using System.IO; using Xunit; @@ -26,10 +25,13 @@ public class FilePathTests public abstract class FilePathTest : AutoFixtureTestBase { protected string CreateFilePath(string? extension) - => Path.Combine($@"{Create()}:\", CreateString(), CreateString(), CreateFileName(extension)); + => Path.Combine( + Path.GetTempPath(), + Create(), + CreateFileName(extension)); protected string CreateFileName(string? extension) - => $"{CreateString()}{(!String.IsNullOrWhiteSpace(extension) ? $".{extension}" : String.Empty)}"; + => $"{Create()}{(!string.IsNullOrWhiteSpace(extension) ? $".{extension}" : string.Empty)}"; public class ZipExtensionsData : ValuesAttribute { diff --git a/tests/Tableau.Migration.Tests/Unit/StreamExtensionsTests.cs b/tests/Tableau.Migration.Tests/Unit/StreamExtensionsTests.cs index 5942722..8e75852 100644 --- a/tests/Tableau.Migration.Tests/Unit/StreamExtensionsTests.cs +++ b/tests/Tableau.Migration.Tests/Unit/StreamExtensionsTests.cs @@ -140,7 +140,7 @@ public void False_when_stream_length_is_too_short() { var bytes = StreamExtensions.ZIP_LEAD_BYTES.Take(3); - var stream = CreateStream(3, bytes); + var stream = CreateStream(0, bytes); Assert.False(stream.IsZip()); }