Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/2.1.1 #15

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<Version>2.1.0</Version>
<Version>2.1.1</Version>
<Authors>Tableau Software, LLC</Authors>
<Company>Tableau Software, LLC</Company>
<Copyright>Copyright (c) 2024, Tableau Software, LLC and its licensors</Copyright>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
Expand All @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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! ##")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<IMigrationManifestEntry>().ToImmutableArray();
Expand Down
8 changes: 5 additions & 3 deletions tests/Tableau.Migration.Tests/Unit/FilePathTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
// limitations under the License.
//

using System;
using System.Collections.Immutable;
using System.IO;
using Xunit;
Expand All @@ -26,10 +25,13 @@ public class FilePathTests
public abstract class FilePathTest : AutoFixtureTestBase
{
protected string CreateFilePath(string? extension)
=> Path.Combine($@"{Create<char>()}:\", CreateString(), CreateString(), CreateFileName(extension));
=> Path.Combine(
Path.GetTempPath(),
Create<string>(),
CreateFileName(extension));

protected string CreateFileName(string? extension)
=> $"{CreateString()}{(!String.IsNullOrWhiteSpace(extension) ? $".{extension}" : String.Empty)}";
=> $"{Create<string>()}{(!string.IsNullOrWhiteSpace(extension) ? $".{extension}" : string.Empty)}";

public class ZipExtensionsData : ValuesAttribute<string>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
Loading