Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
fef73a3
First attempt at implementing default release behavior
nagilson Nov 22, 2022
b897115
Basic case is working.
nagilson Nov 22, 2022
1657da1
Add test for failing if conflicting (need asset) AND fix logic
nagilson Nov 24, 2022
0d5d088
Improve test quality
nagilson Nov 28, 2022
0ed140f
Update the name of some publish release and pack release related strings
nagilson Nov 29, 2022
d67c269
Move the pack error to a place where it'll actually trigger and fix r…
nagilson Nov 29, 2022
f2d81f0
Remove the publishsinglefileError that I somehow added -- don't know …
nagilson Nov 29, 2022
de55192
Make tests that demonstrate the new default behavior
nagilson Nov 29, 2022
0b7520e
Add test for pack release multi-targeting. Publishing with multi-targ…
nagilson Nov 29, 2022
954ce09
Use simple identifier for the test
nagilson Dec 15, 2022
d0dcfa1
Use specialized asserts instead of asset.true
nagilson Dec 15, 2022
e7d07d2
Simplify a pack release test identifier
nagilson Dec 15, 2022
8be1cbd
use path.combine instead of string concat in pack release test
nagilson Dec 15, 2022
9e6e28e
Respond to some basic pr feedback about tests and tmp files
nagilson Dec 15, 2022
390f985
Respond to all of the 'nits' before the more substantive issues
nagilson Dec 15, 2022
890169f
Consider multi-targeted projects with inherit implicit p*release conf…
nagilson Dec 19, 2022
be3728c
[WIP] Add test infra code to create test solutions
nagilson Dec 20, 2022
7d897c7
Clean-up test code regarding TestSolution.cs
nagilson Dec 20, 2022
65e819c
Merge remote-tracking branch 'primary/main' into nagilson-publish-rel…
nagilson Dec 20, 2022
cc99dc5
Merge with main
nagilson Dec 20, 2022
e2616d8
Fail even if P*Release not defined, and enable PackRelease regardless…
nagilson Jan 11, 2023
b303257
[WIP] check the target framework in a better way
nagilson Jan 11, 2023
cb7f0b1
Move PublishRelease default to a new area so it can be picked up in p…
nagilson Jan 12, 2023
983e49e
Update solution tests to use correct identifier syntax
nagilson Jan 12, 2023
09e53a5
Merge branch 'nagilson-publish-release-default' of https://github.com…
nagilson Jan 12, 2023
12557b8
Do PublishRelease error only if IsPublishing so we don't fail VS publish
nagilson Jan 12, 2023
d140c91
Make it so the P*Release errors dont occur if env-var opt out enabled.
nagilson Jan 12, 2023
aac4107
Cleanup code and add the names of a TON of edge cases in tests with m…
nagilson Jan 12, 2023
025aec4
Make the code build before finishing tests
nagilson Jan 12, 2023
57844da
Merge remote-tracking branch 'primary/main' into nagilson-publish-rel…
nagilson Jan 12, 2023
2f0fcc2
update xlf post merge of PR and ILLink error conflict
nagilson Jan 12, 2023
e36427a
Update tests and fix bug where the solution arbitrary project not def…
nagilson Jan 13, 2023
98fa0e6
Consider that the filepath of project is not a fullpath
nagilson Jan 13, 2023
3a3d4a0
[WIP] Fix some of the newly added PublishRelease tests
nagilson Jan 14, 2023
2f7c1d3
Merge branch 'main' into nagilson-publish-release-default
nagilson Jan 17, 2023
1bb42a1
.WithTargetframeworks uses Targetframeworks instead of TargetFramewor…
nagilson Jan 17, 2023
466b909
Fix a bug I added trying to simplify code where publish command parse…
nagilson Jan 17, 2023
ec10854
CONSIDER: 1 Project Turns Into 9 Evaluations With Pack Multitarget ->…
nagilson Jan 17, 2023
ccda58c
Make publish tests with Debug hardcoded use Release. Code cleanup.
nagilson Jan 18, 2023
0638edc
Fix some more tests expecting publish debug
nagilson Jan 18, 2023
44b2397
Clean-up publishrelease default code again before review, anticipatin…
nagilson Jan 18, 2023
1fc9949
Make error message not say use Directory.Build.props because it doesn…
nagilson Jan 18, 2023
b3a342e
Remove quotes from error message
nagilson Jan 18, 2023
eb32cf3
UCR test to use release config instead of debug
nagilson Jan 18, 2023
bfd1f90
PublishRelease only affects publish test change
nagilson Jan 18, 2023
80b58d5
Fix solution handling code to not undefine properties if not set
nagilson Jan 18, 2023
0447d59
Fix some crappy code in .net tool pack test per @dsplaisted where mul…
nagilson Jan 19, 2023
f3fc8d6
Revert back to the old error message
nagilson Jan 19, 2023
c301b25
[!] Change the design to be slower but break less customers.
nagilson Jan 19, 2023
66b69bb
Update one remaining test to reflect new change that fails less often
nagilson Jan 19, 2023
be4ef83
Respond to PR feedback and add the slow and fast way as a flag
nagilson Jan 24, 2023
90ed485
Merge remote-tracking branch 'primary/main' into nagilson-publish-rel…
nagilson Jan 24, 2023
baa0905
Remove test with the old environment variable idea.
nagilson Jan 24, 2023
d94f360
Remove the test solution files and update tests
nagilson Jan 24, 2023
59abc25
Clean up remaining tests with removed solution file gunk code that ca…
nagilson Jan 24, 2023
2523195
Improve comment clarity by removing TFM and making it TargetFramework
nagilson Jan 25, 2023
9803137
Respond to PR feedback -> improve comments regarding PublishRelease, …
nagilson Jan 25, 2023
168a0dd
Merge branch 'nagilson-publish-release-default' of https://github.com…
nagilson Jan 25, 2023
47a78ee
Make a comment point to what MSBuild code it is relying oon
nagilson Jan 26, 2023
693546c
Use Assert.Equal instead of Assert.True ==
nagilson Jan 26, 2023
af4eb20
Use Path.Combine instead of str + str
nagilson Jan 26, 2023
ebf7fea
Remove the "v" that was supposed to be a down arrow in the comment
nagilson Jan 26, 2023
fda2de8
Update parameter name to reflect the pass by reference default of C#
nagilson Jan 26, 2023
d057474
Be clear that Configuration > PublishRelease or PackRelease in the er…
nagilson Jan 26, 2023
66e4967
Check that FileInfo exists instead of using Assert.True(File.Exists..…
nagilson Jan 26, 2023
a353113
Do FileInfo asserts because they give the path if they fail
nagilson Jan 26, 2023
51e4385
Fix a small typo in the test name
nagilson Jan 26, 2023
951e941
Use Tuples with named elements instead of a Tuple<K, V>
nagilson Jan 26, 2023
0c7d76f
Use named tuples over Tuple<>
nagilson Jan 26, 2023
26e5f57
Respond to PR feedback to improve code quality
nagilson Jan 27, 2023
71902de
Merge branch 'nagilson-publish-release-default' of https://github.com…
nagilson Jan 27, 2023
905b44b
Update XLF
nagilson Jan 27, 2023
3d70802
Respond to PR feedback to improve test code quality for publishrelease
nagilson Jan 27, 2023
d6e4e38
Remove the / in a test that would fail because paths in linux are dif…
nagilson Jan 27, 2023
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
Prev Previous commit
Next Next commit
Make the code build before finishing tests
  • Loading branch information
nagilson committed Jan 12, 2023
commit 025aec44e31db1c0d8efeda1efe2e85a170883c9
6 changes: 4 additions & 2 deletions src/Cli/dotnet/ReleasePropertyProjectLocator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ string propertyToCheck
public IEnumerable<string> GetCustomDefaultConfigurationValueIfSpecified()
{
// Setup
#nullable enable
Debug.Assert(_propertyToCheck == MSBuildPropertyNames.PUBLISH_RELEASE || _propertyToCheck == MSBuildPropertyNames.PACK_RELEASE, "Only PackRelease or PublishRelease are currently expected.");
var nothing = Enumerable.Empty<string>();
if (String.Equals(Environment.GetEnvironmentVariable(EnvironmentVariableNames.DISABLE_PUBLISH_AND_PACK_RELEASE), "true", StringComparison.OrdinalIgnoreCase))
Expand All @@ -67,7 +68,7 @@ public IEnumerable<string> GetCustomDefaultConfigurationValueIfSpecified()
return nothing;

// Determine the project being acted upon
ProjectInstance project = GetTargetedProject(globalProperties);
ProjectInstance? project = GetTargetedProject(globalProperties);

// Determine the correct value to return
if (project != null)
Expand Down Expand Up @@ -118,7 +119,7 @@ public IEnumerable<string> GetCustomDefaultConfigurationValueIfSpecified()
}
catch (GracefulException) // Fall back to looking for a solution if multiple project files are found, or there's no project in the directory.
{
string potentialSln = Directory.GetFiles(arg, "*.sln", SearchOption.TopDirectoryOnly).FirstOrDefault();
string? potentialSln = Directory.GetFiles(arg, "*.sln", SearchOption.TopDirectoryOnly).FirstOrDefault();

if (!string.IsNullOrEmpty(potentialSln))
{
Expand Down Expand Up @@ -171,6 +172,7 @@ public IEnumerable<string> GetCustomDefaultConfigurationValueIfSpecified()
Reporter.Error.WriteLine(e.Message);
}
return null;
#nullable disable
}

/// <returns>Returns true if the path exists and is a project file type.</returns>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ internal Tuple<TestSolution, List<TestProject>> Setup(ITestOutputHelper log, str
}


[InlineData("PackRelease")]
[InlineData("PublishRelease")]
[Theory]
public void ItUsesReleaseWithNet8PlusAndNet7WhereNoneDefineTheReleaseProperty(string releaseProperty)
Expand Down Expand Up @@ -101,97 +100,109 @@ public void ItWorksWithASpecificSolutionPathGiven()

}

[InlineData("-f netx.0")]
[InlineData("-p:TargetFramework=netx.0")]
[Theory]
public void ItPublishesReleaseWithATargetFrameworkOptionNet8ForNet6AndNet7MultitargetingProjectWithPublishReleaseUndefined
public void ItPublishesReleaseWithATargetFrameworkOptionNet8ForNet6AndNet7MultitargetingProjectWithPublishReleaseUndefined(string args)
{
// property and option theory

Console.WriteLine(args);
}

[InlineData("-f netx.0")]
[InlineData("-p:TargetFramework=netx.0")]
[Theory]
public void ItPublishesDebugWithATargetFrameworkOptionNet7ForNet8Net7ProjectAndNet7Net6ProjectSolutionWithPublishReleaseUndefined
public void ItPublishesDebugWithATargetFrameworkOptionNet7ForNet8Net7ProjectAndNet7Net6ProjectSolutionWithPublishReleaseUndefined(string args)
{
// property and option theory

Console.WriteLine(args);
}

[Fact]
public void ItPacksDebugWithMutlitargetingWhereNet8AndNet7ProjectDefinePackReleaseFalse
public void ItPacksDebugWithMutlitargetingWhereNet8AndNet7ProjectDefinePackReleaseFalse()
{

}

[Fact]
public void ItPacksDebugWithSolutionWithNet8ProjectAndNet8tNet6ProjectThatDefinePackReleaseFalse
public void ItPacksDebugWithSolutionWithNet8ProjectAndNet8tNet6ProjectThatDefinePackReleaseFalse()
{

}

[Fact]
public void ItFailsToPackWithMultiProjectSolutionWithConflictingPackRelease
public void ItFailsToPackWithMultiProjectSolutionWithConflictingPackRelease()
{

}

[Fact]
public void ItPacksReleaseWithANet8ProjectAndNet7ProjectSolutionWherePackReleaseUndefined
public void ItPacksReleaseWithANet8ProjectAndNet7ProjectSolutionWherePackReleaseUndefined()
{

}

[Fact]
public void ItPacksReleaseWithNet8Net7MultitargetProjectWithPackReleaseUndefined
public void ItPacksReleaseWithNet8Net7MultitargetProjectWithPackReleaseUndefined()
{

}

[InlineData("PackRelease")]
[InlineData("PublishRelease")]
[Theory]
public void ItDoesntErrorIfEnvironmentVariableOptOutEnabledButReleaseConflicts
public void ItDoesntErrorIfEnvironmentVariableOptOutEnabledButReleaseConflicts(string releaseProperty)
{
// publish and pack theory
Console.WriteLine(releaseProperty);
}

[InlineData("PackRelease")]
[InlineData("PublishRelease")]
[Theory]
public void ItDoesntErrorIfReleaseConflictsInVisualStudio
public void ItDoesntErrorIfReleaseConflictsInVisualStudio(string releaseProperty)
{
// publish and pack theory
Console.WriteLine(releaseProperty);

}

[Fact]
public void ItPublishesWithReleaseWhenNet8ProjectWithNothingAndNet7ProjectWithPublishReleaseDefinitionUsed
public void ItPublishesWithReleaseWhenNet8ProjectWithNothingAndNet7ProjectWithPublishReleaseDefinitionUsed()
{

}

[InlineData("true")]
[InlineData("false")]
[Theory]
public void ItFailsWhenNet8ProjectWithPublishReleaseDefinedButNet7ProjectDoesNotDefine
public void ItFailsWhenNet8ProjectWithPublishReleaseDefinedButNet7ProjectDoesNotDefine(string publishReleaseValue)
{
// true and false theory
}
Console.WriteLine(publishReleaseValue);

}


[Fact]
public void ItDoesNotErrorWhenNet7AndNet6ProjectDontDefinePublishRelease
public void ItDoesNotErrorWhenNet7AndNet6ProjectDontDefinePublishRelease()
{

}

[InlineData("true")]
[InlineData("false")]
[InlineData("")]
[Theory]
public void ItFailsWithNet8ProjectAndNet7ProjectSolutionWithPublishReleaseUndefined
public void ItFailsWithNet8ProjectAndNet7ProjectSolutionWithPublishReleaseUndefined(string publishReleaseValue)
{
// net 8 defines publishrelease none, true and false
Console.WriteLine(publishReleaseValue);

}

[Fact]
public void ItFailsIfNet7DefinesPublishReleaseFalseButNet8PlusDefinesNone
public void ItFailsIfNet7DefinesPublishReleaseFalseButNet8PlusDefinesNone()
{

}

[Fact]
public void ItPublishesReleaseIfNet7DefinesPublishReleaseTrueNet8PlusDfinesNothing
public void ItPublishesReleaseIfNet7DefinesPublishReleaseTrueNet8PlusDfinesNothing()
{

}
Expand Down