This repository has been archived by the owner on Nov 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 520
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add buildProperties to project service configuration (#383)
* Add buildArgs to service configuration and capture build configuration as global property to setup msbuild project * Fix format * Fix - Error CS8600: Converting null literal or possible null value to non-nullable type. * Improve configuration format for build arguments * Fix whitespace format * Fix error CS8618: Non-nullable property 'Properties' is uninitialized. Consider declaring the property as nullable. * Fix error CS8601: Possible null reference assignment. * Translate non first class properties as /p:{Key}={Value} into the build command * Fix property translation * All properties are used to create the msbuild project * Change the name (to BuildProperties) and the type (to List<BuildProperty>) of ConfigService property to load build properties * Add support of build properties when tye run with --docker option * Fix ComprehensionalTest * Add tests to verify the output directory for the corresponding build configuration * Fix whitespace format * Override the correct CreateTestCasesForTheory to fix error CS0618 * Remove the usage of BuildPropertiesToOptionsMap and fix the code format
- Loading branch information
1 parent
7ad3b48
commit d429d0b
Showing
17 changed files
with
216 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace Microsoft.Tye.ConfigModel | ||
{ | ||
public class BuildProperty | ||
{ | ||
[Required] | ||
public string Name { get; set; } = default!; | ||
|
||
[Required] | ||
public string Value { get; set; } = default!; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using Xunit; | ||
using Xunit.Sdk; | ||
|
||
namespace E2ETest | ||
{ | ||
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] | ||
[XunitTestCaseDiscoverer("E2ETest." + nameof(ConditionalTheoryDiscoverer), "Microsoft.Tye.E2ETest")] | ||
public class ConditionalTheoryAttribute : TheoryAttribute | ||
{ | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
test/E2ETest/Infrastructure/ConditionalTheoryDiscoverer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System.Collections.Generic; | ||
|
||
using Xunit.Abstractions; | ||
using Xunit.Sdk; | ||
|
||
namespace E2ETest | ||
{ | ||
internal class ConditionalTheoryDiscoverer : TheoryDiscoverer | ||
{ | ||
private readonly IMessageSink _diagnosticMessageSink; | ||
|
||
public ConditionalTheoryDiscoverer(IMessageSink diagnosticMessageSink) | ||
: base(diagnosticMessageSink) | ||
{ | ||
_diagnosticMessageSink = diagnosticMessageSink; | ||
} | ||
|
||
protected override IEnumerable<IXunitTestCase> CreateTestCasesForTheory( | ||
ITestFrameworkDiscoveryOptions discoveryOptions, | ||
ITestMethod testMethod, | ||
IAttributeInfo theoryAttribute) | ||
{ | ||
var skipReason = testMethod.EvaluateSkipConditions(); | ||
return skipReason != null | ||
? new IXunitTestCase[] | ||
{ | ||
new SkippedTestCase( | ||
skipReason, | ||
_diagnosticMessageSink, | ||
discoveryOptions.MethodDisplayOrDefault(), | ||
TestMethodDisplayOptions.None, | ||
testMethod) | ||
} | ||
: base.CreateTestCasesForTheory(discoveryOptions, testMethod, theoryAttribute); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
test/E2ETest/testassets/projects/frontend-backend/tye-debug-configuration.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# tye application configuration file | ||
# read all about it at https://github.com/dotnet/tye | ||
name: frontend-backend | ||
services: | ||
- name: backend | ||
project: backend/backend.csproj | ||
buildProperties: | ||
- name: Configuration | ||
value: Debug | ||
- name: frontend | ||
project: frontend/frontend.csproj | ||
buildProperties: | ||
- name: Configuration | ||
value: Debug |
14 changes: 14 additions & 0 deletions
14
test/E2ETest/testassets/projects/frontend-backend/tye-release-configuration.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# tye application configuration file | ||
# read all about it at https://github.com/dotnet/tye | ||
name: frontend-backend | ||
services: | ||
- name: backend | ||
project: backend/backend.csproj | ||
buildProperties: | ||
- name: Configuration | ||
value: Release | ||
- name: frontend | ||
project: frontend/frontend.csproj | ||
buildProperties: | ||
- name: Configuration | ||
value: Release |
Oops, something went wrong.