Skip to content

Commit

Permalink
Merge pull request Azure#5351 from weshaggard/EnableWarnAsError
Browse files Browse the repository at this point in the history
Enable WarnAsError for official builds
  • Loading branch information
weshaggard authored Mar 11, 2019
2 parents dea6c0e + cb07c66 commit aac3024
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 27 deletions.
5 changes: 1 addition & 4 deletions .azure-pipelines/client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@ jobs:
inputs:
version: '$(DotNetCoreVersion)'

- task: DotNetCoreCLI@2
- script: 'dotnet pack $(ProjectFile) -o $(Build.ArtifactStagingDirectory) -warnaserror'
displayName: 'Build and Package'
inputs:
command: pack
packagesToPack: '$(ProjectFile)'
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
Expand Down
5 changes: 5 additions & 0 deletions eng/Directory.Build.Data.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
<Platform Condition="'$(Platform)' == ''">AnyCPU</Platform>
<PlatformName Condition="'$(PlatformName)' == ''">$(Platform)</PlatformName>
<LangVersion>latest</LangVersion>
<!--
Disable NuGet Pack warning that the version is SemVer 2.0.
SemVer 2.0 is supported by NuGet since 3.0.0 (July 2015) in some capacity, and fully since 3.5.0 (October 2016).
-->
<NoWarn>$(NoWarn);NU5105</NoWarn>
<SignAssembly>true</SignAssembly>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ private static void TestSignVerify(KeyVaultClient client, KeyBundle keyBundle, i
Assert.False(verified);
#endif
}

/*
public void CreateGetDeleteKeyTest()
{
using (MockContext context = MockContext.Start(this.GetType().FullName))
Expand Down Expand Up @@ -457,7 +457,7 @@ public void CreateGetDeleteKeyTest()
Assert.True(recoveryLevelIsConsistent, "the 'recoveryLevel' attribute did not consistently return the expected value.");
}
}

*/
[Fact]
public void CreateHsmKeyTest()
{
Expand Down Expand Up @@ -764,7 +764,7 @@ public void SecretBackupRestoreTest()

try
{
// Backup the secret
// Backup the secret
var backupResponse = client.BackupSecretAsync(_vaultAddress, name).GetAwaiter().GetResult();

client.DeleteSecretAsync(_vaultAddress, name).Wait();
Expand Down Expand Up @@ -967,7 +967,7 @@ public void GetDeletedKeyTest()
Assert.True(recoveryLevelIsConsistent, "the 'recoveryLevel' attribute did not consistently return the expected value.");
}
}

/*
public void KeyCreateDeleteRecoverPurgeTest()
{
using (MockContext context = MockContext.Start(this.GetType().FullName))
Expand Down Expand Up @@ -1065,7 +1065,7 @@ public void KeyCreateDeleteRecoverPurgeTest()
Assert.True(recoveryLevelIsConsistent, "the 'recoveryLevel' attribute did not consistently return the expected value.");
}
}

*/
[Fact]
public void ListDeletedKeysTest()
{
Expand Down Expand Up @@ -1156,7 +1156,7 @@ public void ListDeletedKeysTest()
#endregion

#region Secret Operations

/*
public void SecretCreateUpdateDeleteTest()
{
using (MockContext context = MockContext.Start(this.GetType().FullName))
Expand Down Expand Up @@ -1231,7 +1231,7 @@ public void SecretCreateUpdateDeleteTest()
}
}
}

*/
[Fact]
public void GetSecretVersionTest()
{
Expand Down Expand Up @@ -1542,7 +1542,7 @@ public void GetDeletedSecretTest()
Assert.True(recoveryLevelIsConsistent, "the 'recoveryLevel' attribute did not consistently return the expected value.");
}
}

/*
public void SecretCreateDeleteRecoverPurgeTest()
{
using (MockContext context = MockContext.Start(this.GetType().FullName))
Expand Down Expand Up @@ -1643,7 +1643,7 @@ public void SecretCreateDeleteRecoverPurgeTest()
Assert.True(recoveryLevelAttributeIsConsistent, "The 'recoveryLevel' attribute did not consistently return the expected value");
}
}

*/
[Fact]
public void ListDeletedSecretsTest()
{
Expand Down Expand Up @@ -2421,7 +2421,7 @@ public void CertificateCreateLongSelfSignedTest()
Assert.True(0 == string.CompareOrdinal(retrievedCertificate.SubjectName.Name, certificateSubjectName));
Assert.True(0 == string.CompareOrdinal(retrievedCertificate.IssuerName.Name, certificateSubjectName));

// 24 months (ie 2 years) is 729 or 730 days.
// 24 months (ie 2 years) is 729 or 730 days.
// for some reason the validity is 731 (+ some) days though
var validity = retrievedCertificate.NotAfter - retrievedCertificate.NotBefore;
Assert.True(validity >= TimeSpan.FromDays(729));
Expand Down Expand Up @@ -2512,7 +2512,7 @@ public void CertificateCreateTestIssuerTest()
Assert.True(0 == string.CompareOrdinal(retrievedCertificate.SubjectName.Name, certificateSubjectName));
Assert.True(0 == string.CompareOrdinal(retrievedCertificate.IssuerName.Name, certificateSubjectName));

// 24 months (ie 2 years) is 729 or 730 days.
// 24 months (ie 2 years) is 729 or 730 days.
// for some reason the validity is 731 (+ some) days though
var validity = retrievedCertificate.NotAfter - retrievedCertificate.NotBefore;
Assert.True(validity >= TimeSpan.FromDays(729));
Expand Down Expand Up @@ -2601,7 +2601,7 @@ public void CertificateAsyncRequestCancellationTest()
}
}
}

/*
public void CertificateAsyncDeleteOperationTest()
{
using (MockContext context = MockContext.Start(this.GetType().FullName))
Expand Down Expand Up @@ -2695,7 +2695,7 @@ public void CertificateAsyncDeleteOperationTest()
}
}
}

*/
[Fact]
public void CertificateUpdateTest()
{
Expand Down Expand Up @@ -3151,7 +3151,7 @@ public void GetDeletedCertificateTest()
policy).GetAwaiter().GetResult();
recoveryLevelIsConsistent &= VerifyDeletionRecoveryLevel(createdCertificateBundle.Attributes, _softDeleteEnabled);

// add another version
// add another version
var attributes = new CertificateAttributes
{
Enabled = true,
Expand Down Expand Up @@ -3201,7 +3201,7 @@ public void GetDeletedCertificateTest()
Assert.True(recoveryLevelIsConsistent, "The 'recoveryLevel' attribute did not consistently return the expected value.");
}
}

/*
public void CertificateCreateDeleteRecoverPurgeTest()
{
using (MockContext context = MockContext.Start(this.GetType().FullName))
Expand Down Expand Up @@ -3328,7 +3328,7 @@ public void CertificateCreateDeleteRecoverPurgeTest()
Assert.True(recoveryLevelIsConsistent, "The 'recoveryLevel' attribute did not consistently return the expected value");
}
}

*/
[Fact]
public void ListDeletedCertificatesTest()
{
Expand Down Expand Up @@ -3649,7 +3649,7 @@ public void StorageRegenerateKeyTest()
}
}
}

/*
public void StorageSasDefCreateTest()
{
using (MockContext.Start(this.GetType().FullName))
Expand Down Expand Up @@ -3834,7 +3834,7 @@ public void StorageSasDefListTest()
}
}
}

*/
#endregion

#region Helper Methods
Expand Down Expand Up @@ -3902,7 +3902,7 @@ private void WrapAndUnwrap(KeyVaultClient client, KeyIdentifier keyIdentifier, s
/// </summary>
/// <param name="keyIdentifier"> key identifier </param>
/// <param name="algorithm"> sign algorithm </param>
/// <param name="digest"> digest hash </param>
/// <param name="digest"> digest hash </param>
private void SignVerify(KeyVaultClient client, KeyIdentifier keyIdentifier, string algorithm, byte[] digest)
{
var signResult = client.SignAsync(keyIdentifier.BaseIdentifier, algorithm, digest).GetAwaiter().GetResult();
Expand Down Expand Up @@ -4037,7 +4037,7 @@ private void VerifyTagsAreEqual(IDictionary<string, string> expected, IDictionar
/// Creates a key bundle from existing key material.
/// </summary>
/// <param name="keyType">Key type.</param>
/// <param name="keyToken">Key material or content description.</param>
/// <param name="keyToken">Key material or content description.</param>
/// <param name="enabled">Initial 'enabled' state.</param>
/// <param name="notBefore">Key cannot be used before this time.</param>
/// <param name="notAfter">Key cannot be used after this time.</param>
Expand All @@ -4050,7 +4050,7 @@ protected static KeyBundle GetImportKeyBundle(string keyType, byte[] keyToken =
/// <summary>
/// Creates a key bundle from an existing JSON web key.
/// </summary>
/// <param name="key">The key to import. Must contain public and private components.</param>
/// <param name="key">The key to import. Must contain public and private components.</param>
/// <param name="enabled">Initial 'enabled' state.</param>
/// <param name="notBefore">Key cannot be used before this time.</param>
/// <param name="notAfter">Key cannot be used after this time.</param>
Expand Down Expand Up @@ -4238,15 +4238,15 @@ private class HttpClientFactory
/// <returns>An http client instance with the specified delegating handlers as the inner pipeline.</returns>
/// <remarks>
/// * The original implementation of this class is in the System.Net.Http.Formatting assembly, which
/// does not support .netcoreApp as a target framework.
/// does not support .netcoreApp as a target framework.
/// * Since the class is private, no parameter validation is required. However, the provider
/// of the delegating handler array must behave, and ensure there are no preset inners.
/// </remarks>
public static HttpClient Create(DelegatingHandler[] handlers)
{
for (int idx = 1; idx < handlers.Length; idx++)
{
// set each previous handler as the inner of the subsequent one.
// set each previous handler as the inner of the subsequent one.
// Last handler becomes the first handler in the pipeline.
handlers[idx].InnerHandler = handlers[idx - 1];
}
Expand Down

0 comments on commit aac3024

Please sign in to comment.