From 084d476f9c190dc475e453eabee83c109cbafe70 Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Mon, 12 Aug 2024 12:59:44 +0400 Subject: [PATCH 01/51] Added changes to proj and script to add building and laying out net8 version --- src/Common.props | 11 +++++++++-- src/dev.sh | 14 +++++++++----- src/dir.proj | 35 +++++++++++++++++++++++++++-------- 3 files changed, 45 insertions(+), 15 deletions(-) diff --git a/src/Common.props b/src/Common.props index f782ae844f..21ae0becfa 100644 --- a/src/Common.props +++ b/src/Common.props @@ -1,7 +1,6 @@ - net6 - 6.0.32 + net6.0;net8.0 $(PackageRuntime) true true @@ -22,6 +21,14 @@ DEBUG + + 6.0.32 + + + + 8.0.7 + + OS_WINDOWS diff --git a/src/dev.sh b/src/dev.sh index 1877a8f775..dfa2033382 100755 --- a/src/dev.sh +++ b/src/dev.sh @@ -21,7 +21,7 @@ source "$SCRIPT_DIR/.helpers.sh" REPO_ROOT="${SCRIPT_DIR}/.." DOTNETSDK_ROOT="${REPO_ROOT}/_dotnetsdk" -DOTNETSDK_VERSION="6.0.424" +DOTNETSDK_VERSION="8.0.303" DOTNETSDK_INSTALLDIR="$DOTNETSDK_ROOT/$DOTNETSDK_VERSION" AGENT_VERSION=$(cat "$SCRIPT_DIR/agentversion" | head -n 1 | tr -d "\n\r") @@ -126,10 +126,14 @@ function cmd_layout () #change execution flag to allow running with sudo if [[ ("$CURRENT_PLATFORM" == "linux") || ("$CURRENT_PLATFORM" == "darwin") ]]; then - chmod +x "${LAYOUT_DIR}/bin/Agent.Listener" - chmod +x "${LAYOUT_DIR}/bin/Agent.Worker" - chmod +x "${LAYOUT_DIR}/bin/Agent.PluginHost" - chmod +x "${LAYOUT_DIR}/bin/installdependencies.sh" + chmod +x "${LAYOUT_DIR}/net6/bin/Agent.Listener" + chmod +x "${LAYOUT_DIR}/net8/bin/Agent.Listener" + chmod +x "${LAYOUT_DIR}/net6/bin/Agent.Worker" + chmod +x "${LAYOUT_DIR}/net8/bin/Agent.Worker" + chmod +x "${LAYOUT_DIR}/net6/bin/Agent.PluginHost" + chmod +x "${LAYOUT_DIR}/net8/bin/Agent.PluginHost" + chmod +x "${LAYOUT_DIR}/net6/bin/installdependencies.sh" + chmod +x "${LAYOUT_DIR}/net8/bin/installdependencies.sh" fi heading "Setup externals folder for $RUNTIME_ID agent's layout" diff --git a/src/dir.proj b/src/dir.proj index b6b7f2fad9..b921d1e807 100644 --- a/src/dir.proj +++ b/src/dir.proj @@ -73,8 +73,25 @@ Projects="@(ProjectFiles)" SkipNonExistentProjects="false" StopOnFirstFailure="true" - Properties="Configuration=$(BUILDCONFIG);PackageRuntime=$(PackageRuntime);Version=$(AgentVersion);RuntimeIdentifier=$(PackageRuntime);PublishDir=$(LayoutRoot)/bin;TreatWarningsAsErrors=$(TreatWarningsAsErrors)" /> - + Properties="Configuration=$(BUILDCONFIG);PackageRuntime=$(PackageRuntime);Version=$(AgentVersion);RuntimeIdentifier=$(PackageRuntime);PublishDir=$(LayoutRoot)/net6/bin/;TreatWarningsAsErrors=$(TreatWarningsAsErrors);TargetFramework=net6" /> + + + + + + + + + + + + + @@ -106,14 +123,16 @@ - - + + + + - - - - + + + + From 523eb456465d9ceefeb1d3c0fff94c04931fd5fb Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Mon, 12 Aug 2024 13:20:41 +0400 Subject: [PATCH 02/51] Fixed target names --- src/dir.proj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dir.proj b/src/dir.proj index b921d1e807..6dca26be00 100644 --- a/src/dir.proj +++ b/src/dir.proj @@ -73,14 +73,14 @@ Projects="@(ProjectFiles)" SkipNonExistentProjects="false" StopOnFirstFailure="true" - Properties="Configuration=$(BUILDCONFIG);PackageRuntime=$(PackageRuntime);Version=$(AgentVersion);RuntimeIdentifier=$(PackageRuntime);PublishDir=$(LayoutRoot)/net6/bin/;TreatWarningsAsErrors=$(TreatWarningsAsErrors);TargetFramework=net6" /> + Properties="Configuration=$(BUILDCONFIG);PackageRuntime=$(PackageRuntime);Version=$(AgentVersion);RuntimeIdentifier=$(PackageRuntime);PublishDir=$(LayoutRoot)/net6/bin/;TreatWarningsAsErrors=$(TreatWarningsAsErrors);TargetFramework=net6.0" /> + Properties="Configuration=$(BUILDCONFIG);PackageRuntime=$(PackageRuntime);Version=$(AgentVersion);RuntimeIdentifier=$(PackageRuntime);PublishDir=$(LayoutRoot)/net8/bin/;TreatWarningsAsErrors=$(TreatWarningsAsErrors);TargetFramework=net8.0" /> From 2240ff541d6d837c7bfbdbd460fabc18b14d71f2 Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Mon, 12 Aug 2024 23:24:29 +0400 Subject: [PATCH 03/51] Added externals layout for net8 --- src/dev.sh | 17 +++++++++++------ src/dir.proj | 4 ++-- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/dev.sh b/src/dev.sh index dfa2033382..b87c697742 100755 --- a/src/dev.sh +++ b/src/dev.sh @@ -106,9 +106,9 @@ function make_build (){ || failed build fi - mkdir -p "${LAYOUT_DIR}/bin/en-US" + mkdir -p "${LAYOUT_DIR}/net6/bin/en-US" "${LAYOUT_DIR}/net8/bin/en-US" - grep -v '^ *"CLI-WIDTH-' ./Misc/layoutbin/en-US/strings.json > "${LAYOUT_DIR}/bin/en-US/strings.json" + grep -v '^ *"CLI-WIDTH-' ./Misc/layoutbin/en-US/strings.json | tee "${LAYOUT_DIR}/net6/bin/en-US/strings.json" > "${LAYOUT_DIR}/net8/bin/en-US/strings.json" } function cmd_build () @@ -127,17 +127,22 @@ function cmd_layout () #change execution flag to allow running with sudo if [[ ("$CURRENT_PLATFORM" == "linux") || ("$CURRENT_PLATFORM" == "darwin") ]]; then chmod +x "${LAYOUT_DIR}/net6/bin/Agent.Listener" - chmod +x "${LAYOUT_DIR}/net8/bin/Agent.Listener" chmod +x "${LAYOUT_DIR}/net6/bin/Agent.Worker" - chmod +x "${LAYOUT_DIR}/net8/bin/Agent.Worker" chmod +x "${LAYOUT_DIR}/net6/bin/Agent.PluginHost" - chmod +x "${LAYOUT_DIR}/net8/bin/Agent.PluginHost" chmod +x "${LAYOUT_DIR}/net6/bin/installdependencies.sh" + + chmod +x "${LAYOUT_DIR}/net8/bin/Agent.Listener" + chmod +x "${LAYOUT_DIR}/net8/bin/Agent.Worker" + chmod +x "${LAYOUT_DIR}/net8/bin/Agent.PluginHost" chmod +x "${LAYOUT_DIR}/net8/bin/installdependencies.sh" fi heading "Setup externals folder for $RUNTIME_ID agent's layout" - bash ./Misc/externals.sh $RUNTIME_ID || checkRC externals.sh + + bash ./Misc/externals.sh $RUNTIME_ID "" "_layout/${RUNTIME_ID}" || checkRC externals.sh + + cp -r "${LAYOUT_DIR}/externals" "${LAYOUT_DIR}/net6" + mv "${LAYOUT_DIR}/externals" "${LAYOUT_DIR}/net8" } function cmd_test_l0 () diff --git a/src/dir.proj b/src/dir.proj index 6dca26be00..444c66fbb0 100644 --- a/src/dir.proj +++ b/src/dir.proj @@ -89,8 +89,8 @@ - - + + From a3372562956401050159c18bb96f0d7c89085679 Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Tue, 13 Aug 2024 12:58:04 +0400 Subject: [PATCH 04/51] Small refactoring --- src/dir.proj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dir.proj b/src/dir.proj index 444c66fbb0..5fe4ca4542 100644 --- a/src/dir.proj +++ b/src/dir.proj @@ -124,8 +124,9 @@ - + + From c2a55b5af3b092df598a23cf852c2b7651840ec9 Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Tue, 13 Aug 2024 18:29:58 +0400 Subject: [PATCH 05/51] Added separate folders for net6 and net8 --- src/Test/L0/TestHostContext.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Test/L0/TestHostContext.cs b/src/Test/L0/TestHostContext.cs index 37c25cf393..f5276aceba 100644 --- a/src/Test/L0/TestHostContext.cs +++ b/src/Test/L0/TestHostContext.cs @@ -23,6 +23,8 @@ namespace Microsoft.VisualStudio.Services.Agent.Tests { public sealed class TestHostContext : IHostContext, IDisposable { + private static readonly string NetVersionFolder = "net" + $"{Environment.Version.Major}"; + private readonly ConcurrentDictionary> _serviceInstances = new ConcurrentDictionary>(); private readonly ConcurrentDictionary _serviceSingletons = new ConcurrentDictionary(); private readonly ITraceManager _traceManager; @@ -63,7 +65,7 @@ public TestHostContext(object testClass, [CallerMemberName] string testName = "" _suiteName = _suiteName.Replace(".", "_", StringComparison.OrdinalIgnoreCase); // Setup the trace manager. - TraceFileName = Path.Combine(TestUtil.GetSrcPath(), "Test", "TestLogs", $"trace_{_suiteName}_{_testName}.log"); + TraceFileName = Path.Combine(TestUtil.GetSrcPath(), "Test", "TestLogs", NetVersionFolder, $"trace_{_suiteName}_{_testName}.log"); if (File.Exists(TraceFileName)) { From d457b324784e3bbf6bb6b8bde03e92d6bc8a5a3b Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Wed, 14 Aug 2024 14:38:40 +0400 Subject: [PATCH 06/51] Changed L1 test execution --- src/dev.sh | 4 ++++ src/dir.proj | 24 ++++++++---------------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/dev.sh b/src/dev.sh index b87c697742..0bc19159cd 100755 --- a/src/dev.sh +++ b/src/dev.sh @@ -168,6 +168,10 @@ function cmd_test_l1 () heading "Setup externals folder for $RUNTIME_ID agent's layout" bash ./Misc/externals.sh $RUNTIME_ID "" "_l1" "true" || checkRC externals.sh + + mkdir ../_l1/net6 ../_l1/net8 + cp -r "../_l1/externals" "../_l1/net6/externals" + mv "../_l1/externals" "../_l1/net8" heading "Testing L1" diff --git a/src/dir.proj b/src/dir.proj index 5fe4ca4542..ea56b71f2e 100644 --- a/src/dir.proj +++ b/src/dir.proj @@ -101,25 +101,17 @@ - - + + - + + - + + - - - + + From 86e9667dda72ae192e255241eeda57211669aa4f Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Wed, 14 Aug 2024 15:42:41 +0400 Subject: [PATCH 07/51] Removed an obsolete constructor in the VerificationException class. --- src/Agent.Listener/ValidationHelper/VerificationException.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Agent.Listener/ValidationHelper/VerificationException.cs b/src/Agent.Listener/ValidationHelper/VerificationException.cs index 155c6a2774..77b0652b86 100644 --- a/src/Agent.Listener/ValidationHelper/VerificationException.cs +++ b/src/Agent.Listener/ValidationHelper/VerificationException.cs @@ -18,10 +18,5 @@ public VerificationException(string message, Exception ex) : base(message, ex) { } - - protected VerificationException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - } } } From c86cd67eb468bb2ed002fe5ebd994e2b096ee079 Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Wed, 14 Aug 2024 16:20:51 +0400 Subject: [PATCH 08/51] Made Test build self-contained --- src/dir.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dir.proj b/src/dir.proj index ea56b71f2e..2483b1bfee 100644 --- a/src/dir.proj +++ b/src/dir.proj @@ -95,7 +95,7 @@ - + From ee02891763594a5a5319217f0f4afe4a2a2c55dc Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Wed, 14 Aug 2024 17:13:32 +0400 Subject: [PATCH 09/51] Fixed L1 log folders --- src/Test/L0/TestHostContext.cs | 1 - src/Test/L1/Worker/L1TestBase.cs | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Test/L0/TestHostContext.cs b/src/Test/L0/TestHostContext.cs index f5276aceba..17cf05ca7d 100644 --- a/src/Test/L0/TestHostContext.cs +++ b/src/Test/L0/TestHostContext.cs @@ -24,7 +24,6 @@ namespace Microsoft.VisualStudio.Services.Agent.Tests public sealed class TestHostContext : IHostContext, IDisposable { private static readonly string NetVersionFolder = "net" + $"{Environment.Version.Major}"; - private readonly ConcurrentDictionary> _serviceInstances = new ConcurrentDictionary>(); private readonly ConcurrentDictionary _serviceSingletons = new ConcurrentDictionary(); private readonly ITraceManager _traceManager; diff --git a/src/Test/L1/Worker/L1TestBase.cs b/src/Test/L1/Worker/L1TestBase.cs index db9327fd21..0d6cc054c4 100644 --- a/src/Test/L1/Worker/L1TestBase.cs +++ b/src/Test/L1/Worker/L1TestBase.cs @@ -33,6 +33,7 @@ public class TestResults public class L1TestBase : IDisposable { + private static readonly string NetVersionFolder = "net" + $"{Environment.Version.Major}"; protected TimeSpan ChannelTimeout = TimeSpan.FromSeconds(100); protected TimeSpan JobTimeout = TimeSpan.FromSeconds(100); @@ -278,7 +279,7 @@ private string GetLogFile(object testClass, string testMethod) var testName = testMethod.Replace(".", "_"); return Path.Combine( - Path.Combine(TestUtil.GetSrcPath(), "Test", "TestLogs"), + Path.Combine(TestUtil.GetSrcPath(), "Test", "TestLogs", NetVersionFolder), $"trace_{suiteName}_{testName}.log"); } From adc8994b2c4f19b8ba6a6d2dabc20986d36807ef Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Wed, 14 Aug 2024 18:08:29 +0400 Subject: [PATCH 10/51] Reverted MSBuild tasks in the TestL1 target. --- src/dir.proj | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/dir.proj b/src/dir.proj index 2483b1bfee..995a19fd17 100644 --- a/src/dir.proj +++ b/src/dir.proj @@ -107,6 +107,26 @@ + + + + + + From f7359f9d37762382f94c5db0fde67ce098c33fd8 Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Thu, 15 Aug 2024 12:00:28 +0400 Subject: [PATCH 11/51] Small refactoring --- src/Test/L1/Worker/L1TestBase.cs | 3 +-- src/dir.proj | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Test/L1/Worker/L1TestBase.cs b/src/Test/L1/Worker/L1TestBase.cs index 0d6cc054c4..3f3867742f 100644 --- a/src/Test/L1/Worker/L1TestBase.cs +++ b/src/Test/L1/Worker/L1TestBase.cs @@ -278,8 +278,7 @@ private string GetLogFile(object testClass, string testMethod) startIndex: typeof(Tests.TestHostContext).FullName.LastIndexOf(nameof(TestHostContext))); var testName = testMethod.Replace(".", "_"); - return Path.Combine( - Path.Combine(TestUtil.GetSrcPath(), "Test", "TestLogs", NetVersionFolder), + return Path.Combine(TestUtil.GetSrcPath(), "Test", "TestLogs", NetVersionFolder, $"trace_{suiteName}_{testName}.log"); } diff --git a/src/dir.proj b/src/dir.proj index 995a19fd17..58b55c7444 100644 --- a/src/dir.proj +++ b/src/dir.proj @@ -129,6 +129,8 @@ + + From c936a61334e5b372fe74c0607ad475df90cc19bc Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Thu, 15 Aug 2024 12:12:20 +0400 Subject: [PATCH 12/51] Fixed binaries path --- src/dir.proj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dir.proj b/src/dir.proj index 58b55c7444..854b455e50 100644 --- a/src/dir.proj +++ b/src/dir.proj @@ -118,18 +118,18 @@ Projects="@(ProjectFiles)" SkipNonExistentProjects="false" StopOnFirstFailure="true" - Properties="Configuration=$(BUILDCONFIG);PackageRuntime=$(PackageRuntime);Version=1.0.0.0;RuntimeIdentifier=$(PackageRuntime);PublishDir=$(L1Root)net6/bin;TargetFramework=net6.0" /> + Properties="Configuration=$(BUILDCONFIG);PackageRuntime=$(PackageRuntime);Version=1.0.0.0;RuntimeIdentifier=$(PackageRuntime);PublishDir=$(L1Root)/net6/bin;TargetFramework=net6.0" /> + Properties="Configuration=$(BUILDCONFIG);PackageRuntime=$(PackageRuntime);Version=1.0.0.0;RuntimeIdentifier=$(PackageRuntime);PublishDir=$(L1Root)/net8/bin;TargetFramework=net8.0" /> - + From 2b4e94a8629154fba2cbb8e55eb1507ee0005579 Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Thu, 15 Aug 2024 16:22:04 +0400 Subject: [PATCH 13/51] Updated .Net version --- src/Common.props | 2 +- src/dev.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Common.props b/src/Common.props index 21ae0becfa..4984639a8d 100644 --- a/src/Common.props +++ b/src/Common.props @@ -26,7 +26,7 @@ - 8.0.7 + 8.0.8 diff --git a/src/dev.sh b/src/dev.sh index 0bc19159cd..25d53889d0 100755 --- a/src/dev.sh +++ b/src/dev.sh @@ -21,7 +21,7 @@ source "$SCRIPT_DIR/.helpers.sh" REPO_ROOT="${SCRIPT_DIR}/.." DOTNETSDK_ROOT="${REPO_ROOT}/_dotnetsdk" -DOTNETSDK_VERSION="8.0.303" +DOTNETSDK_VERSION="8.0.400" DOTNETSDK_INSTALLDIR="$DOTNETSDK_ROOT/$DOTNETSDK_VERSION" AGENT_VERSION=$(cat "$SCRIPT_DIR/agentversion" | head -n 1 | tr -d "\n\r") From 02a458635ca5ca503c73a53da6bf474668ee610b Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Thu, 15 Aug 2024 19:30:49 +0400 Subject: [PATCH 14/51] Include runtime to L1 test builds --- src/Test/Test.csproj | 1 + src/dir.proj | 24 ++---------------------- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/src/Test/Test.csproj b/src/Test/Test.csproj index 4ad89dd6ff..84baa8ccc4 100644 --- a/src/Test/Test.csproj +++ b/src/Test/Test.csproj @@ -6,6 +6,7 @@ + diff --git a/src/dir.proj b/src/dir.proj index 854b455e50..5571a5842b 100644 --- a/src/dir.proj +++ b/src/dir.proj @@ -107,28 +107,8 @@ - - - - - - - - + + From 950a0b96eaf6f19fe482b97684d71fe809b06fc0 Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Fri, 16 Aug 2024 14:35:46 +0400 Subject: [PATCH 15/51] Added the musl installation for musl based systems --- src/dir.proj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dir.proj b/src/dir.proj index 5571a5842b..4237125e88 100644 --- a/src/dir.proj +++ b/src/dir.proj @@ -107,6 +107,8 @@ + + From 7c446d82ae16dbcba0ea970c47f27ead296b1496 Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Fri, 16 Aug 2024 14:47:25 +0400 Subject: [PATCH 16/51] Added debug info --- src/dir.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dir.proj b/src/dir.proj index 4237125e88..9a1eed7b1d 100644 --- a/src/dir.proj +++ b/src/dir.proj @@ -107,7 +107,7 @@ - + From 9a56db24a124eccd90313146eaeae0ffb7794e2c Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Fri, 16 Aug 2024 15:02:30 +0400 Subject: [PATCH 17/51] Added musl install --- src/dev.sh | 14 +++++--------- src/dir.proj | 2 -- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/dev.sh b/src/dev.sh index 25d53889d0..12e6ef9dce 100755 --- a/src/dev.sh +++ b/src/dev.sh @@ -367,15 +367,6 @@ fi heading ".NET SDK to path" -echo "Adding .NET to PATH (${DOTNETSDK_INSTALLDIR})" -export PATH=${DOTNETSDK_INSTALLDIR}:$PATH -echo "Path = $PATH" -echo ".NET Version = $(dotnet --version)" - -heading "Pre-caching external resources for $RUNTIME_ID" -mkdir -p "${LAYOUT_DIR}" >/dev/null -bash ./Misc/externals.sh $RUNTIME_ID "Pre-Cache" || checkRC "externals.sh Pre-Cache" - if [[ "$CURRENT_PLATFORM" == 'windows' ]]; then vswhere=$(find "$DOWNLOAD_DIR" -name vswhere.exe | head -1) vs_location=$("$vswhere" -latest -property installationPath) @@ -392,6 +383,11 @@ if [[ "$CURRENT_PLATFORM" == 'windows' ]]; then export DesktopMSBuild="$msbuild_location" fi +if [[ ("$RUNTIME_ID" == 'linux-musl-x64') || ("$RUNTIME_ID" == 'linux-musl-arm64') ]]; then + echo "Installing musl.." + bash "apk add musl" +fi + case $DEV_CMD in "build") cmd_build;; "b") cmd_build;; diff --git a/src/dir.proj b/src/dir.proj index 9a1eed7b1d..5571a5842b 100644 --- a/src/dir.proj +++ b/src/dir.proj @@ -107,8 +107,6 @@ - - From 45d58e8250aa7bd1de93acce32d587b56a81b7b7 Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Fri, 16 Aug 2024 15:24:07 +0400 Subject: [PATCH 18/51] Small fix --- src/dev.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dev.sh b/src/dev.sh index 12e6ef9dce..6164014bab 100755 --- a/src/dev.sh +++ b/src/dev.sh @@ -385,7 +385,7 @@ fi if [[ ("$RUNTIME_ID" == 'linux-musl-x64') || ("$RUNTIME_ID" == 'linux-musl-arm64') ]]; then echo "Installing musl.." - bash "apk add musl" + apk add musl fi case $DEV_CMD in From f737e3e9c7d3a0f6c9b24854d32cef399d5974af Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Fri, 16 Aug 2024 16:23:14 +0400 Subject: [PATCH 19/51] Add Install .NET Core 6 SDK for all systems --- .azure-pipelines/build-job.yml | 30 ++++++++++++++---------------- src/dev.sh | 5 ----- src/dir.proj | 6 +++--- 3 files changed, 17 insertions(+), 24 deletions(-) diff --git a/.azure-pipelines/build-job.yml b/.azure-pipelines/build-job.yml index 9137d159fd..810412c60b 100644 --- a/.azure-pipelines/build-job.yml +++ b/.azure-pipelines/build-job.yml @@ -166,15 +166,14 @@ jobs: # Run l0 tests - ${{ if parameters.unitTests }}: - - ${{ if and(eq(parameters.os, 'win'), eq(parameters.arch, 'x86')) }}: - - task: UseDotNet@2 - displayName: Install .NET Core 6 Runtime - inputs: - version: '6.0.x' - packageType: 'runtime' - installationPath: 'C:\Program Files (x86)\dotnet' - env: - PROCESSOR_ARCHITECTURE: x86 + - task: UseDotNet@2 + displayName: Install .NET Core 6 Runtime + inputs: + version: '6.0.x' + packageType: 'runtime' + installationPath: 'C:\Program Files (x86)\dotnet' + env: + PROCESSOR_ARCHITECTURE: x86 - script: ${{ variables.devCommand }} testl0 Debug ${{ parameters.os }}-${{ parameters.arch }} workingDirectory: src displayName: Unit tests @@ -182,13 +181,12 @@ jobs: # Run l1 tests - ${{ if parameters.functionalTests }}: - - ${{ if and(eq(parameters.os, 'win'), eq(parameters.arch, 'x86')) }}: - - task: UseDotNet@2 - displayName: Install .NET Core 6 SDK - inputs: - version: '6.0.424' - packageType: sdk - performMultiLevelLookup: true + - task: UseDotNet@2 + displayName: Install .NET Core 6 SDK + inputs: + version: '6.0.424' + packageType: sdk + performMultiLevelLookup: true - script: ${{ variables.devCommand }} testl1 Debug ${{ parameters.os }}-${{ parameters.arch }} workingDirectory: src displayName: Functional tests diff --git a/src/dev.sh b/src/dev.sh index 6164014bab..52aeed0024 100755 --- a/src/dev.sh +++ b/src/dev.sh @@ -383,11 +383,6 @@ if [[ "$CURRENT_PLATFORM" == 'windows' ]]; then export DesktopMSBuild="$msbuild_location" fi -if [[ ("$RUNTIME_ID" == 'linux-musl-x64') || ("$RUNTIME_ID" == 'linux-musl-arm64') ]]; then - echo "Installing musl.." - apk add musl -fi - case $DEV_CMD in "build") cmd_build;; "b") cmd_build;; diff --git a/src/dir.proj b/src/dir.proj index 5571a5842b..f502706113 100644 --- a/src/dir.proj +++ b/src/dir.proj @@ -95,7 +95,7 @@ - + @@ -107,8 +107,8 @@ - - + + From b475a0fd67fd107a08b65c176a8a3584dcd79d10 Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Fri, 16 Aug 2024 16:59:19 +0400 Subject: [PATCH 20/51] Reverted changes --- src/dev.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/dev.sh b/src/dev.sh index 52aeed0024..25d53889d0 100755 --- a/src/dev.sh +++ b/src/dev.sh @@ -367,6 +367,15 @@ fi heading ".NET SDK to path" +echo "Adding .NET to PATH (${DOTNETSDK_INSTALLDIR})" +export PATH=${DOTNETSDK_INSTALLDIR}:$PATH +echo "Path = $PATH" +echo ".NET Version = $(dotnet --version)" + +heading "Pre-caching external resources for $RUNTIME_ID" +mkdir -p "${LAYOUT_DIR}" >/dev/null +bash ./Misc/externals.sh $RUNTIME_ID "Pre-Cache" || checkRC "externals.sh Pre-Cache" + if [[ "$CURRENT_PLATFORM" == 'windows' ]]; then vswhere=$(find "$DOWNLOAD_DIR" -name vswhere.exe | head -1) vs_location=$("$vswhere" -latest -property installationPath) From 6a25247b974cb45983e504d5f15d170548de4c02 Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Sat, 17 Aug 2024 00:05:43 +0400 Subject: [PATCH 21/51] Added installation for both SDKs --- .azure-pipelines/build-job.yml | 14 ------ src/dev.sh | 86 +++++++++++++++++++--------------- 2 files changed, 47 insertions(+), 53 deletions(-) diff --git a/.azure-pipelines/build-job.yml b/.azure-pipelines/build-job.yml index 810412c60b..d4282337aa 100644 --- a/.azure-pipelines/build-job.yml +++ b/.azure-pipelines/build-job.yml @@ -166,14 +166,6 @@ jobs: # Run l0 tests - ${{ if parameters.unitTests }}: - - task: UseDotNet@2 - displayName: Install .NET Core 6 Runtime - inputs: - version: '6.0.x' - packageType: 'runtime' - installationPath: 'C:\Program Files (x86)\dotnet' - env: - PROCESSOR_ARCHITECTURE: x86 - script: ${{ variables.devCommand }} testl0 Debug ${{ parameters.os }}-${{ parameters.arch }} workingDirectory: src displayName: Unit tests @@ -181,12 +173,6 @@ jobs: # Run l1 tests - ${{ if parameters.functionalTests }}: - - task: UseDotNet@2 - displayName: Install .NET Core 6 SDK - inputs: - version: '6.0.424' - packageType: sdk - performMultiLevelLookup: true - script: ${{ variables.devCommand }} testl1 Debug ${{ parameters.os }}-${{ parameters.arch }} workingDirectory: src displayName: Functional tests diff --git a/src/dev.sh b/src/dev.sh index 25d53889d0..9607ff9854 100755 --- a/src/dev.sh +++ b/src/dev.sh @@ -21,8 +21,8 @@ source "$SCRIPT_DIR/.helpers.sh" REPO_ROOT="${SCRIPT_DIR}/.." DOTNETSDK_ROOT="${REPO_ROOT}/_dotnetsdk" -DOTNETSDK_VERSION="8.0.400" -DOTNETSDK_INSTALLDIR="$DOTNETSDK_ROOT/$DOTNETSDK_VERSION" +DOTNETSDK6_VERSION="6.0.424" +DOTNETSDK8_VERSION="8.0.401" AGENT_VERSION=$(cat "$SCRIPT_DIR/agentversion" | head -n 1 | tr -d "\n\r") DOTNET_ERROR_PREFIX="##vso[task.logissue type=error]" @@ -41,6 +41,46 @@ if [[ "$DEV_CONFIG" == "Release" ]]; then BUILD_CONFIG="Release" fi +function install_dotnet_sdk() +{ + DOTNETSDK_VERSION=$1 + + if [[ (! -d "${DOTNETSDK_ROOT}") || (! -e "${DOTNETSDK_ROOT}/.${DOTNETSDK_VERSION}") || (! -e "${DOTNETSDK_ROOT}/dotnet") ]]; then + + # _dotnetsdk + # \1.0.x + # \dotnet + # \.1.0.x + echo "Download dotnetsdk ${DOTNETSDK_VERSION} into ${DOTNETSDK_ROOT}" + + # run dotnet-install.ps1 on windows, dotnet-install.sh on linux + if [[ "${CURRENT_PLATFORM}" == "windows" ]]; then + ext="ps1" + else + ext="sh" + fi + + DOTNET_INSTALL_SCRIPT_NAME="dotnet-install.${ext}" + DOTNET_INSTALL_SCRIPT_PATH="./Misc/${DOTNET_INSTALL_SCRIPT_NAME}" + + if [[ ! -e "${DOTNET_INSTALL_SCRIPT_PATH}" ]]; then + curl -sSL "https://dot.net/v1/${DOTNET_INSTALL_SCRIPT_NAME}" -o "${DOTNET_INSTALL_SCRIPT_PATH}" + fi + + if [[ "${CURRENT_PLATFORM}" == "windows" ]]; then + echo "Convert ${DOTNETSDK_ROOT} to Windows style path" + sdkinstallwindow_path=${DOTNETSDK_ROOT:1} + sdkinstallwindow_path=${sdkinstallwindow_path:0:1}:${sdkinstallwindow_path:1} + architecture=$( echo $RUNTIME_ID | cut -d "-" -f2) + powershell -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "& \"${DOTNET_INSTALL_SCRIPT_PATH}\" -Version ${DOTNETSDK_VERSION} -InstallDir \"${sdkinstallwindow_path}\" -Architecture ${architecture} -NoPath; exit \$LastExitCode;" || checkRC "${DOTNET_INSTALL_SCRIPT_NAME}" + else + bash "${DOTNET_INSTALL_SCRIPT_PATH}" --version ${DOTNETSDK_VERSION} --install-dir "${DOTNETSDK_ROOT}" --no-path || checkRC "${DOTNET_INSTALL_SCRIPT_NAME}" + fi + + echo "${DOTNETSDK_VERSION}" > "${DOTNETSDK_ROOT}/.${DOTNETSDK_VERSION}" + fi +} + function detect_platform_and_runtime_id () { heading "Platform / RID detection" @@ -326,44 +366,12 @@ DOWNLOAD_DIR="${REPO_ROOT}/_downloads/${RUNTIME_ID}/netcore2x" PACKAGE_DIR="${REPO_ROOT}/_package/${RUNTIME_ID}" REPORT_DIR="${REPO_ROOT}/_reports/${RUNTIME_ID}" -if [[ (! -d "${DOTNETSDK_INSTALLDIR}") || (! -e "${DOTNETSDK_INSTALLDIR}/.${DOTNETSDK_VERSION}") || (! -e "${DOTNETSDK_INSTALLDIR}/dotnet") ]]; then - - # Download dotnet SDK to ../_dotnetsdk directory - heading "Install .NET SDK" - - # _dotnetsdk - # \1.0.x - # \dotnet - # \.1.0.x - echo "Download dotnetsdk into ${DOTNETSDK_INSTALLDIR}" - rm -Rf "${DOTNETSDK_DIR}" - - # run dotnet-install.ps1 on windows, dotnet-install.sh on linux - if [[ "${CURRENT_PLATFORM}" == "windows" ]]; then - ext="ps1" - else - ext="sh" - fi - - DOTNET_INSTALL_SCRIPT_NAME="dotnet-install.${ext}" - DOTNET_INSTALL_SCRIPT_PATH="./Misc/${DOTNET_INSTALL_SCRIPT_NAME}" +# Download dotnet SDK to ../_dotnetsdk directory +heading "Install .NET SDK" +rm -Rf "${DOTNETSDK_ROOT}" - if [[ ! -e "${DOTNET_INSTALL_SCRIPT_PATH}" ]]; then - curl -sSL "https://dot.net/v1/${DOTNET_INSTALL_SCRIPT_NAME}" -o "${DOTNET_INSTALL_SCRIPT_PATH}" - fi - - if [[ "${CURRENT_PLATFORM}" == "windows" ]]; then - echo "Convert ${DOTNETSDK_INSTALLDIR} to Windows style path" - sdkinstallwindow_path=${DOTNETSDK_INSTALLDIR:1} - sdkinstallwindow_path=${sdkinstallwindow_path:0:1}:${sdkinstallwindow_path:1} - architecture=$( echo $RUNTIME_ID | cut -d "-" -f2) - powershell -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "& \"${DOTNET_INSTALL_SCRIPT_PATH}\" -Version ${DOTNETSDK_VERSION} -InstallDir \"${sdkinstallwindow_path}\" -Architecture ${architecture} -NoPath; exit \$LastExitCode;" || checkRC "${DOTNET_INSTALL_SCRIPT_NAME}" - else - bash "${DOTNET_INSTALL_SCRIPT_PATH}" --version ${DOTNETSDK_VERSION} --install-dir "${DOTNETSDK_INSTALLDIR}" --no-path || checkRC "${DOTNET_INSTALL_SCRIPT_NAME}" - fi - - echo "${DOTNETSDK_VERSION}" > "${DOTNETSDK_INSTALLDIR}/.${DOTNETSDK_VERSION}" -fi +install_dotnet_sdk $DOTNETSDK6_VERSION +install_dotnet_sdk $DOTNETSDK8_VERSION heading ".NET SDK to path" From 5ecb6c29697b41b8acadec1815635a0498340e5d Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Sat, 17 Aug 2024 13:40:18 +0400 Subject: [PATCH 22/51] Fixed adding .NET folder to PATH env var. --- src/dev.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dev.sh b/src/dev.sh index 9607ff9854..24b57193cc 100755 --- a/src/dev.sh +++ b/src/dev.sh @@ -375,8 +375,8 @@ install_dotnet_sdk $DOTNETSDK8_VERSION heading ".NET SDK to path" -echo "Adding .NET to PATH (${DOTNETSDK_INSTALLDIR})" -export PATH=${DOTNETSDK_INSTALLDIR}:$PATH +echo "Adding .NET to PATH (${DOTNETSDK_ROOT)" +export PATH=${DOTNETSDK_ROOT}:$PATH echo "Path = $PATH" echo ".NET Version = $(dotnet --version)" From cdfbdc487d93dfab3ff1332481b15d32c18576f4 Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Sat, 17 Aug 2024 13:47:19 +0400 Subject: [PATCH 23/51] Fixed a typo; renamed var --- src/dev.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/dev.sh b/src/dev.sh index 24b57193cc..6b4c8cff9e 100755 --- a/src/dev.sh +++ b/src/dev.sh @@ -20,7 +20,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source "$SCRIPT_DIR/.helpers.sh" REPO_ROOT="${SCRIPT_DIR}/.." -DOTNETSDK_ROOT="${REPO_ROOT}/_dotnetsdk" +DOTNETSDK_INSTALLDIR="${REPO_ROOT}/_dotnetsdk" DOTNETSDK6_VERSION="6.0.424" DOTNETSDK8_VERSION="8.0.401" AGENT_VERSION=$(cat "$SCRIPT_DIR/agentversion" | head -n 1 | tr -d "\n\r") @@ -45,13 +45,13 @@ function install_dotnet_sdk() { DOTNETSDK_VERSION=$1 - if [[ (! -d "${DOTNETSDK_ROOT}") || (! -e "${DOTNETSDK_ROOT}/.${DOTNETSDK_VERSION}") || (! -e "${DOTNETSDK_ROOT}/dotnet") ]]; then + if [[ (! -d "${DOTNETSDK_INSTALLDIR}") || (! -e "${DOTNETSDK_INSTALLDIR}/.${DOTNETSDK_VERSION}") || (! -e "${DOTNETSDK_INSTALLDIR}/dotnet") ]]; then # _dotnetsdk # \1.0.x # \dotnet # \.1.0.x - echo "Download dotnetsdk ${DOTNETSDK_VERSION} into ${DOTNETSDK_ROOT}" + echo "Download dotnetsdk ${DOTNETSDK_VERSION} into ${DOTNETSDK_INSTALLDIR}" # run dotnet-install.ps1 on windows, dotnet-install.sh on linux if [[ "${CURRENT_PLATFORM}" == "windows" ]]; then @@ -68,16 +68,16 @@ function install_dotnet_sdk() fi if [[ "${CURRENT_PLATFORM}" == "windows" ]]; then - echo "Convert ${DOTNETSDK_ROOT} to Windows style path" - sdkinstallwindow_path=${DOTNETSDK_ROOT:1} + echo "Convert ${DOTNETSDK_INSTALLDIR} to Windows style path" + sdkinstallwindow_path=${DOTNETSDK_INSTALLDIR:1} sdkinstallwindow_path=${sdkinstallwindow_path:0:1}:${sdkinstallwindow_path:1} architecture=$( echo $RUNTIME_ID | cut -d "-" -f2) powershell -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "& \"${DOTNET_INSTALL_SCRIPT_PATH}\" -Version ${DOTNETSDK_VERSION} -InstallDir \"${sdkinstallwindow_path}\" -Architecture ${architecture} -NoPath; exit \$LastExitCode;" || checkRC "${DOTNET_INSTALL_SCRIPT_NAME}" else - bash "${DOTNET_INSTALL_SCRIPT_PATH}" --version ${DOTNETSDK_VERSION} --install-dir "${DOTNETSDK_ROOT}" --no-path || checkRC "${DOTNET_INSTALL_SCRIPT_NAME}" + bash "${DOTNET_INSTALL_SCRIPT_PATH}" --version ${DOTNETSDK_VERSION} --install-dir "${DOTNETSDK_INSTALLDIR}" --no-path || checkRC "${DOTNET_INSTALL_SCRIPT_NAME}" fi - echo "${DOTNETSDK_VERSION}" > "${DOTNETSDK_ROOT}/.${DOTNETSDK_VERSION}" + echo "${DOTNETSDK_VERSION}" > "${DOTNETSDK_INSTALLDIR}/.${DOTNETSDK_VERSION}" fi } @@ -368,15 +368,15 @@ REPORT_DIR="${REPO_ROOT}/_reports/${RUNTIME_ID}" # Download dotnet SDK to ../_dotnetsdk directory heading "Install .NET SDK" -rm -Rf "${DOTNETSDK_ROOT}" +rm -Rf "${DOTNETSDK_INSTALLDIR}" install_dotnet_sdk $DOTNETSDK6_VERSION install_dotnet_sdk $DOTNETSDK8_VERSION heading ".NET SDK to path" -echo "Adding .NET to PATH (${DOTNETSDK_ROOT)" -export PATH=${DOTNETSDK_ROOT}:$PATH +echo "Adding .NET to PATH (${DOTNETSDK_INSTALLDIR})" +export PATH=${DOTNETSDK_INSTALLDIR}:$PATH echo "Path = $PATH" echo ".NET Version = $(dotnet --version)" From 497a599e395cf0b82b264e3308caecd2644baa16 Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Sat, 17 Aug 2024 14:07:40 +0400 Subject: [PATCH 24/51] Removed 'rm' command for dotnetsdk folder. --- src/dev.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/src/dev.sh b/src/dev.sh index 6b4c8cff9e..f03a967cfb 100755 --- a/src/dev.sh +++ b/src/dev.sh @@ -368,7 +368,6 @@ REPORT_DIR="${REPO_ROOT}/_reports/${RUNTIME_ID}" # Download dotnet SDK to ../_dotnetsdk directory heading "Install .NET SDK" -rm -Rf "${DOTNETSDK_INSTALLDIR}" install_dotnet_sdk $DOTNETSDK6_VERSION install_dotnet_sdk $DOTNETSDK8_VERSION From c58cd02c6cbfbc387c14e28cf7cdd2165ddf8d12 Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Sat, 17 Aug 2024 23:40:57 +0400 Subject: [PATCH 25/51] Specified runtime version for 'dotnet test' --- src/dir.proj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dir.proj b/src/dir.proj index f502706113..73bfe4d047 100644 --- a/src/dir.proj +++ b/src/dir.proj @@ -112,8 +112,8 @@ - - + + From d5f902643d1751ea7c1605d8c4b2a8be1b828aeb Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Mon, 19 Aug 2024 14:36:33 +0400 Subject: [PATCH 26/51] Reverted changes in proj file --- src/dir.proj | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/dir.proj b/src/dir.proj index 73bfe4d047..9daef1ef03 100644 --- a/src/dir.proj +++ b/src/dir.proj @@ -107,6 +107,26 @@ + + + + + + From 19bce974a51de9b0becf86128b90b8e15e235e4b Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Mon, 19 Aug 2024 14:50:17 +0400 Subject: [PATCH 27/51] Removed Plugin Host reference from Test proj --- src/Test/Test.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Test/Test.csproj b/src/Test/Test.csproj index 84baa8ccc4..4ad89dd6ff 100644 --- a/src/Test/Test.csproj +++ b/src/Test/Test.csproj @@ -6,7 +6,6 @@ - From 625317c4788d7b2d465ff8e85e1c25bbc049c3dd Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Mon, 26 Aug 2024 16:02:58 +0400 Subject: [PATCH 28/51] Refactored changes --- src/Common.props | 11 +-- src/Test/L0/TestHostContext.cs | 3 +- src/dev.sh | 150 +++++++++++++++++---------------- src/dir.proj | 64 ++++---------- 4 files changed, 95 insertions(+), 133 deletions(-) diff --git a/src/Common.props b/src/Common.props index 4984639a8d..ad6773a515 100644 --- a/src/Common.props +++ b/src/Common.props @@ -1,6 +1,7 @@ - net6.0;net8.0 + $(NetTargetFramework) + $(RuntimeVersion) $(PackageRuntime) true true @@ -21,14 +22,6 @@ DEBUG - - 6.0.32 - - - - 8.0.8 - - OS_WINDOWS diff --git a/src/Test/L0/TestHostContext.cs b/src/Test/L0/TestHostContext.cs index 17cf05ca7d..37c25cf393 100644 --- a/src/Test/L0/TestHostContext.cs +++ b/src/Test/L0/TestHostContext.cs @@ -23,7 +23,6 @@ namespace Microsoft.VisualStudio.Services.Agent.Tests { public sealed class TestHostContext : IHostContext, IDisposable { - private static readonly string NetVersionFolder = "net" + $"{Environment.Version.Major}"; private readonly ConcurrentDictionary> _serviceInstances = new ConcurrentDictionary>(); private readonly ConcurrentDictionary _serviceSingletons = new ConcurrentDictionary(); private readonly ITraceManager _traceManager; @@ -64,7 +63,7 @@ public TestHostContext(object testClass, [CallerMemberName] string testName = "" _suiteName = _suiteName.Replace(".", "_", StringComparison.OrdinalIgnoreCase); // Setup the trace manager. - TraceFileName = Path.Combine(TestUtil.GetSrcPath(), "Test", "TestLogs", NetVersionFolder, $"trace_{_suiteName}_{_testName}.log"); + TraceFileName = Path.Combine(TestUtil.GetSrcPath(), "Test", "TestLogs", $"trace_{_suiteName}_{_testName}.log"); if (File.Exists(TraceFileName)) { diff --git a/src/dev.sh b/src/dev.sh index f03a967cfb..e4b2440641 100755 --- a/src/dev.sh +++ b/src/dev.sh @@ -8,21 +8,28 @@ set -eo pipefail +# .NET version for agent build +declare -A NET_VERSIONS=( + ["net6.0-sdk"]="6.0.424" + ["net6.0-runtime"]="6.0.32" + + ["net8.0-sdk"]="8.0.401" + ["net8.0-runtime"]="8.0.8" +) + ALL_ARGS=("$@") DEV_CMD=$1 -DEV_CONFIG=$2 -DEV_RUNTIME_ID=$3 -DEV_TEST_FILTERS=$4 -DEV_ARGS=("${ALL_ARGS[@]:4}") +TARGET_FRAMEWORK=$2 +DEV_CONFIG=$3 +DEV_RUNTIME_ID=$4 +DEV_TEST_FILTERS=$5 +DEV_ARGS=("${ALL_ARGS[@]:5}") SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source "$SCRIPT_DIR/.helpers.sh" REPO_ROOT="${SCRIPT_DIR}/.." -DOTNETSDK_INSTALLDIR="${REPO_ROOT}/_dotnetsdk" -DOTNETSDK6_VERSION="6.0.424" -DOTNETSDK8_VERSION="8.0.401" AGENT_VERSION=$(cat "$SCRIPT_DIR/agentversion" | head -n 1 | tr -d "\n\r") DOTNET_ERROR_PREFIX="##vso[task.logissue type=error]" @@ -36,50 +43,27 @@ fi pushd "$SCRIPT_DIR" -BUILD_CONFIG="Debug" -if [[ "$DEV_CONFIG" == "Release" ]]; then - BUILD_CONFIG="Release" -fi - -function install_dotnet_sdk() -{ - DOTNETSDK_VERSION=$1 - - if [[ (! -d "${DOTNETSDK_INSTALLDIR}") || (! -e "${DOTNETSDK_INSTALLDIR}/.${DOTNETSDK_VERSION}") || (! -e "${DOTNETSDK_INSTALLDIR}/dotnet") ]]; then +DEFAULT_TARGET_FRAMEWORK="net6.0" - # _dotnetsdk - # \1.0.x - # \dotnet - # \.1.0.x - echo "Download dotnetsdk ${DOTNETSDK_VERSION} into ${DOTNETSDK_INSTALLDIR}" +if [[ $TARGET_FRAMEWORK == "" ]]; then + TARGET_FRAMEWORK=$DEFAULT_TARGET_FRAMEWORK +fi - # run dotnet-install.ps1 on windows, dotnet-install.sh on linux - if [[ "${CURRENT_PLATFORM}" == "windows" ]]; then - ext="ps1" - else - ext="sh" - fi +DOTNETSDK_VERSION=${NET_VERSIONS["${TARGET_FRAMEWORK}-sdk"]} +DOTNETRUNTIME_VERSION=${NET_VERSIONS["${TARGET_FRAMEWORK}-runtime"]} - DOTNET_INSTALL_SCRIPT_NAME="dotnet-install.${ext}" - DOTNET_INSTALL_SCRIPT_PATH="./Misc/${DOTNET_INSTALL_SCRIPT_NAME}" +if [[ ($DOTNETSDK_VERSION == "") || ($DOTNETRUNTIME_VERSION == "") ]]; then + failed "Incorrect target framework is specified" +fi - if [[ ! -e "${DOTNET_INSTALL_SCRIPT_PATH}" ]]; then - curl -sSL "https://dot.net/v1/${DOTNET_INSTALL_SCRIPT_NAME}" -o "${DOTNET_INSTALL_SCRIPT_PATH}" - fi - if [[ "${CURRENT_PLATFORM}" == "windows" ]]; then - echo "Convert ${DOTNETSDK_INSTALLDIR} to Windows style path" - sdkinstallwindow_path=${DOTNETSDK_INSTALLDIR:1} - sdkinstallwindow_path=${sdkinstallwindow_path:0:1}:${sdkinstallwindow_path:1} - architecture=$( echo $RUNTIME_ID | cut -d "-" -f2) - powershell -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "& \"${DOTNET_INSTALL_SCRIPT_PATH}\" -Version ${DOTNETSDK_VERSION} -InstallDir \"${sdkinstallwindow_path}\" -Architecture ${architecture} -NoPath; exit \$LastExitCode;" || checkRC "${DOTNET_INSTALL_SCRIPT_NAME}" - else - bash "${DOTNET_INSTALL_SCRIPT_PATH}" --version ${DOTNETSDK_VERSION} --install-dir "${DOTNETSDK_INSTALLDIR}" --no-path || checkRC "${DOTNET_INSTALL_SCRIPT_NAME}" - fi +DOTNETSDK_ROOT="${REPO_ROOT}/_dotnetsdk" +DOTNETSDK_INSTALLDIR="$DOTNETSDK_ROOT/$DOTNETSDK_VERSION" - echo "${DOTNETSDK_VERSION}" > "${DOTNETSDK_INSTALLDIR}/.${DOTNETSDK_VERSION}" - fi -} +BUILD_CONFIG="Debug" +if [[ "$DEV_CONFIG" == "Release" ]]; then + BUILD_CONFIG="Release" +fi function detect_platform_and_runtime_id () { @@ -137,18 +121,18 @@ function make_build (){ if [[ "$ADO_ENABLE_LOGISSUE" == "true" ]]; then - dotnet msbuild -t:"${TARGET}" -p:PackageRuntime="${RUNTIME_ID}" -p:PackageType="${PACKAGE_TYPE}" -p:BUILDCONFIG="${BUILD_CONFIG}" -p:AgentVersion="${AGENT_VERSION}" -p:LayoutRoot="${LAYOUT_DIR}" -p:CodeAnalysis="true" \ + dotnet msbuild -t:"${TARGET}" -p:PackageRuntime="${RUNTIME_ID}" -p:PackageType="${PACKAGE_TYPE}" -p:BUILDCONFIG="${BUILD_CONFIG}" -p:AgentVersion="${AGENT_VERSION}" -p:LayoutRoot="${LAYOUT_DIR}" -p:CodeAnalysis="true" -p:NetTargetFramework="${TARGET_FRAMEWORK}" -p:RuntimeVersion="${DOTNETRUNTIME_VERSION}" \ | sed -e "/\: warning /s/^/${DOTNET_WARNING_PREFIX} /;" \ | sed -e "/\: error /s/^/${DOTNET_ERROR_PREFIX} /;" \ || failed build else - dotnet msbuild -t:"${TARGET}" -p:PackageRuntime="${RUNTIME_ID}" -p:PackageType="${PACKAGE_TYPE}" -p:BUILDCONFIG="${BUILD_CONFIG}" -p:AgentVersion="${AGENT_VERSION}" -p:LayoutRoot="${LAYOUT_DIR}" -p:CodeAnalysis="true" \ + dotnet msbuild -t:"${TARGET}" -p:PackageRuntime="${RUNTIME_ID}" -p:PackageType="${PACKAGE_TYPE}" -p:BUILDCONFIG="${BUILD_CONFIG}" -p:AgentVersion="${AGENT_VERSION}" -p:LayoutRoot="${LAYOUT_DIR}" -p:CodeAnalysis="true" -p:NetTargetFramework="${TARGET_FRAMEWORK}" -p:RuntimeVersion="${DOTNETRUNTIME_VERSION}" \ || failed build fi - mkdir -p "${LAYOUT_DIR}/net6/bin/en-US" "${LAYOUT_DIR}/net8/bin/en-US" + mkdir -p "${LAYOUT_DIR}/bin/en-US" - grep -v '^ *"CLI-WIDTH-' ./Misc/layoutbin/en-US/strings.json | tee "${LAYOUT_DIR}/net6/bin/en-US/strings.json" > "${LAYOUT_DIR}/net8/bin/en-US/strings.json" + grep -v '^ *"CLI-WIDTH-' ./Misc/layoutbin/en-US/strings.json > "${LAYOUT_DIR}/bin/en-US/strings.json" } function cmd_build () @@ -166,23 +150,14 @@ function cmd_layout () #change execution flag to allow running with sudo if [[ ("$CURRENT_PLATFORM" == "linux") || ("$CURRENT_PLATFORM" == "darwin") ]]; then - chmod +x "${LAYOUT_DIR}/net6/bin/Agent.Listener" - chmod +x "${LAYOUT_DIR}/net6/bin/Agent.Worker" - chmod +x "${LAYOUT_DIR}/net6/bin/Agent.PluginHost" - chmod +x "${LAYOUT_DIR}/net6/bin/installdependencies.sh" - - chmod +x "${LAYOUT_DIR}/net8/bin/Agent.Listener" - chmod +x "${LAYOUT_DIR}/net8/bin/Agent.Worker" - chmod +x "${LAYOUT_DIR}/net8/bin/Agent.PluginHost" - chmod +x "${LAYOUT_DIR}/net8/bin/installdependencies.sh" + chmod +x "${LAYOUT_DIR}/bin/Agent.Listener" + chmod +x "${LAYOUT_DIR}/bin/Agent.Worker" + chmod +x "${LAYOUT_DIR}/bin/Agent.PluginHost" + chmod +x "${LAYOUT_DIR}/bin/installdependencies.sh" fi heading "Setup externals folder for $RUNTIME_ID agent's layout" - - bash ./Misc/externals.sh $RUNTIME_ID "" "_layout/${RUNTIME_ID}" || checkRC externals.sh - - cp -r "${LAYOUT_DIR}/externals" "${LAYOUT_DIR}/net6" - mv "${LAYOUT_DIR}/externals" "${LAYOUT_DIR}/net8" + bash ./Misc/externals.sh $RUNTIME_ID || checkRC externals.sh } function cmd_test_l0 () @@ -198,7 +173,7 @@ function cmd_test_l0 () TestFilters="$TestFilters&$DEV_TEST_FILTERS" fi - dotnet msbuild -t:testl0 -p:PackageRuntime="${RUNTIME_ID}" -p:PackageType="${PACKAGE_TYPE}" -p:BUILDCONFIG="${BUILD_CONFIG}" -p:AgentVersion="${AGENT_VERSION}" -p:LayoutRoot="${LAYOUT_DIR}" -p:TestFilters="${TestFilters}" "${DEV_ARGS[@]}" || failed "failed tests" + dotnet msbuild -t:testl0 -p:PackageRuntime="${RUNTIME_ID}" -p:PackageType="${PACKAGE_TYPE}" -p:BUILDCONFIG="${BUILD_CONFIG}" -p:AgentVersion="${AGENT_VERSION}" -p:LayoutRoot="${LAYOUT_DIR}" -p:TestFilters="${TestFilters}" -p:NetTargetFramework="${TARGET_FRAMEWORK}" "${DEV_ARGS[@]}" || failed "failed tests" } function cmd_test_l1 () @@ -208,10 +183,6 @@ function cmd_test_l1 () heading "Setup externals folder for $RUNTIME_ID agent's layout" bash ./Misc/externals.sh $RUNTIME_ID "" "_l1" "true" || checkRC externals.sh - - mkdir ../_l1/net6 ../_l1/net8 - cp -r "../_l1/externals" "../_l1/net6/externals" - mv "../_l1/externals" "../_l1/net8" heading "Testing L1" @@ -224,7 +195,7 @@ function cmd_test_l1 () TestFilters="$TestFilters&$DEV_TEST_FILTERS" fi - dotnet msbuild -t:testl1 -p:PackageRuntime="${RUNTIME_ID}" -p:PackageType="${PACKAGE_TYPE}" -p:BUILDCONFIG="${BUILD_CONFIG}" -p:AgentVersion="${AGENT_VERSION}" -p:LayoutRoot="${LAYOUT_DIR}" -p:TestFilters="${TestFilters}" "${DEV_ARGS[@]}" || failed "failed tests" + dotnet msbuild -t:testl1 -p:PackageRuntime="${RUNTIME_ID}" -p:PackageType="${PACKAGE_TYPE}" -p:BUILDCONFIG="${BUILD_CONFIG}" -p:AgentVersion="${AGENT_VERSION}" -p:LayoutRoot="${LAYOUT_DIR}" -p:TestFilters="${TestFilters}" -p:NetTargetFramework="${TARGET_FRAMEWORK}" "${DEV_ARGS[@]}" || failed "failed tests" } function cmd_test () @@ -366,11 +337,44 @@ DOWNLOAD_DIR="${REPO_ROOT}/_downloads/${RUNTIME_ID}/netcore2x" PACKAGE_DIR="${REPO_ROOT}/_package/${RUNTIME_ID}" REPORT_DIR="${REPO_ROOT}/_reports/${RUNTIME_ID}" -# Download dotnet SDK to ../_dotnetsdk directory -heading "Install .NET SDK" +if [[ (! -d "${DOTNETSDK_INSTALLDIR}") || (! -e "${DOTNETSDK_INSTALLDIR}/.${DOTNETSDK_VERSION}") || (! -e "${DOTNETSDK_INSTALLDIR}/dotnet") ]]; then + + # Download dotnet SDK to ../_dotnetsdk directory + heading "Install .NET SDK" + + # _dotnetsdk + # \1.0.x + # \dotnet + # \.1.0.x + echo "Download dotnetsdk into ${DOTNETSDK_INSTALLDIR}" + rm -Rf "${DOTNETSDK_DIR}" + + # run dotnet-install.ps1 on windows, dotnet-install.sh on linux + if [[ "${CURRENT_PLATFORM}" == "windows" ]]; then + ext="ps1" + else + ext="sh" + fi + + DOTNET_INSTALL_SCRIPT_NAME="dotnet-install.${ext}" + DOTNET_INSTALL_SCRIPT_PATH="./Misc/${DOTNET_INSTALL_SCRIPT_NAME}" + + if [[ ! -e "${DOTNET_INSTALL_SCRIPT_PATH}" ]]; then + curl -sSL "https://dot.net/v1/${DOTNET_INSTALL_SCRIPT_NAME}" -o "${DOTNET_INSTALL_SCRIPT_PATH}" + fi + + if [[ "${CURRENT_PLATFORM}" == "windows" ]]; then + echo "Convert ${DOTNETSDK_INSTALLDIR} to Windows style path" + sdkinstallwindow_path=${DOTNETSDK_INSTALLDIR:1} + sdkinstallwindow_path=${sdkinstallwindow_path:0:1}:${sdkinstallwindow_path:1} + architecture=$( echo $RUNTIME_ID | cut -d "-" -f2) + powershell -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "& \"${DOTNET_INSTALL_SCRIPT_PATH}\" -Version ${DOTNETSDK_VERSION} -InstallDir \"${sdkinstallwindow_path}\" -Architecture ${architecture} -NoPath; exit \$LastExitCode;" || checkRC "${DOTNET_INSTALL_SCRIPT_NAME}" + else + bash "${DOTNET_INSTALL_SCRIPT_PATH}" --version ${DOTNETSDK_VERSION} --install-dir "${DOTNETSDK_INSTALLDIR}" --no-path || checkRC "${DOTNET_INSTALL_SCRIPT_NAME}" + fi -install_dotnet_sdk $DOTNETSDK6_VERSION -install_dotnet_sdk $DOTNETSDK8_VERSION + echo "${DOTNETSDK_VERSION}" > "${DOTNETSDK_INSTALLDIR}/.${DOTNETSDK_VERSION}" +fi heading ".NET SDK to path" diff --git a/src/dir.proj b/src/dir.proj index 9daef1ef03..e78640af7d 100644 --- a/src/dir.proj +++ b/src/dir.proj @@ -73,39 +73,19 @@ Projects="@(ProjectFiles)" SkipNonExistentProjects="false" StopOnFirstFailure="true" - Properties="Configuration=$(BUILDCONFIG);PackageRuntime=$(PackageRuntime);Version=$(AgentVersion);RuntimeIdentifier=$(PackageRuntime);PublishDir=$(LayoutRoot)/net6/bin/;TreatWarningsAsErrors=$(TreatWarningsAsErrors);TargetFramework=net6.0" /> - - - - - - - - - - - - - + Properties="Configuration=$(BUILDCONFIG);PackageRuntime=$(PackageRuntime);Version=$(AgentVersion);RuntimeIdentifier=$(PackageRuntime);PublishDir=$(LayoutRoot)/bin;TreatWarningsAsErrors=$(TreatWarningsAsErrors)" /> + - + - + - - - - - + + - - - - - + Properties="Configuration=$(BUILDCONFIG);PackageRuntime=$(PackageRuntime);Version=1.0.0.0;RuntimeIdentifier=$(PackageRuntime);PublishDir=$(L1Root)/bin" /> + - - - + - - - - - + + - - - - + + + + From 2c6905bfbfff027c1c28fbffb32e1267b8ed7dd6 Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Mon, 26 Aug 2024 16:19:11 +0400 Subject: [PATCH 29/51] Fixed L1 --- src/dev.sh | 2 +- src/dir.proj | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dev.sh b/src/dev.sh index e4b2440641..5f8772938f 100755 --- a/src/dev.sh +++ b/src/dev.sh @@ -195,7 +195,7 @@ function cmd_test_l1 () TestFilters="$TestFilters&$DEV_TEST_FILTERS" fi - dotnet msbuild -t:testl1 -p:PackageRuntime="${RUNTIME_ID}" -p:PackageType="${PACKAGE_TYPE}" -p:BUILDCONFIG="${BUILD_CONFIG}" -p:AgentVersion="${AGENT_VERSION}" -p:LayoutRoot="${LAYOUT_DIR}" -p:TestFilters="${TestFilters}" -p:NetTargetFramework="${TARGET_FRAMEWORK}" "${DEV_ARGS[@]}" || failed "failed tests" + dotnet msbuild -t:testl1 -p:PackageRuntime="${RUNTIME_ID}" -p:PackageType="${PACKAGE_TYPE}" -p:BUILDCONFIG="${BUILD_CONFIG}" -p:AgentVersion="${AGENT_VERSION}" -p:LayoutRoot="${LAYOUT_DIR}" -p:TestFilters="${TestFilters}" -p:NetTargetFramework="${TARGET_FRAMEWORK}" -p:RuntimeVersion="${DOTNETRUNTIME_VERSION}" "${DEV_ARGS[@]}" || failed "failed tests" } function cmd_test () diff --git a/src/dir.proj b/src/dir.proj index e78640af7d..5d5d16f3b4 100644 --- a/src/dir.proj +++ b/src/dir.proj @@ -100,9 +100,9 @@ StopOnFirstFailure="true" Properties="Configuration=$(BUILDCONFIG);PackageRuntime=$(PackageRuntime);Version=1.0.0.0;RuntimeIdentifier=$(PackageRuntime);PublishDir=$(L1Root)/bin" /> - + - + From 009a115538eabe50ad0420d3d230b47939c03e8e Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Mon, 26 Aug 2024 16:29:51 +0400 Subject: [PATCH 30/51] Added build matrix --- .azure-pipelines/pipeline.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.azure-pipelines/pipeline.yml b/.azure-pipelines/pipeline.yml index efe5230421..f7daa75283 100644 --- a/.azure-pipelines/pipeline.yml +++ b/.azure-pipelines/pipeline.yml @@ -1,5 +1,12 @@ # This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool. # This pipeline will be extended to the OneESPT template +strategy: + matrix: + NET6.0: + targetFramework: 'net6.0' + NET8.0: + targetFramework: 'net8.0' + parameters: - name: preBuildStages type: stageList From c288b498f753d6f240bcede25cd12bf41f97fd68 Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Mon, 26 Aug 2024 16:39:10 +0400 Subject: [PATCH 31/51] Fixed matrix --- .azure-pipelines/build-job.yml | 7 +++++++ .azure-pipelines/pipeline.yml | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.azure-pipelines/build-job.yml b/.azure-pipelines/build-job.yml index d4282337aa..e7ffd1dc77 100644 --- a/.azure-pipelines/build-job.yml +++ b/.azure-pipelines/build-job.yml @@ -1,4 +1,11 @@ # This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool. +strategy: + matrix: + NET6.0: + targetFramework: 'net6.0' + NET8.0: + targetFramework: 'net8.0' + parameters: - name: jobName diff --git a/.azure-pipelines/pipeline.yml b/.azure-pipelines/pipeline.yml index f7daa75283..efe5230421 100644 --- a/.azure-pipelines/pipeline.yml +++ b/.azure-pipelines/pipeline.yml @@ -1,12 +1,5 @@ # This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool. # This pipeline will be extended to the OneESPT template -strategy: - matrix: - NET6.0: - targetFramework: 'net6.0' - NET8.0: - targetFramework: 'net8.0' - parameters: - name: preBuildStages type: stageList From 4d5c4f98bd1bd58160925696b2db38a915f62a05 Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Mon, 26 Aug 2024 16:42:03 +0400 Subject: [PATCH 32/51] Fixed strategy #2 --- .azure-pipelines/build-job.yml | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/.azure-pipelines/build-job.yml b/.azure-pipelines/build-job.yml index e7ffd1dc77..40b85de667 100644 --- a/.azure-pipelines/build-job.yml +++ b/.azure-pipelines/build-job.yml @@ -1,11 +1,4 @@ # This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool. -strategy: - matrix: - NET6.0: - targetFramework: 'net6.0' - NET8.0: - targetFramework: 'net8.0' - parameters: - name: jobName @@ -85,6 +78,13 @@ jobs: displayName: ${{ parameters.displayName }} pool: ${{ parameters.pool }} timeoutInMinutes: ${{ parameters.timeoutInMinutes }} + strategy: + matrix: + NET6.0: + targetFramework: 'net6.0' + NET8.0: + targetFramework: 'net8.0' + ${{ if ne(parameters.container, '') }}: container: ${{ parameters.container }} @@ -173,6 +173,15 @@ jobs: # Run l0 tests - ${{ if parameters.unitTests }}: + - ${{ if and(eq(parameters.os, 'win'), eq(parameters.arch, 'x86')) }}: + - task: UseDotNet@2 + displayName: Install .NET Core 6 Runtime + inputs: + version: '6.0.x' + packageType: 'runtime' + installationPath: 'C:\Program Files (x86)\dotnet' + env: + PROCESSOR_ARCHITECTURE: x86 - script: ${{ variables.devCommand }} testl0 Debug ${{ parameters.os }}-${{ parameters.arch }} workingDirectory: src displayName: Unit tests @@ -180,6 +189,13 @@ jobs: # Run l1 tests - ${{ if parameters.functionalTests }}: + - ${{ if and(eq(parameters.os, 'win'), eq(parameters.arch, 'x86')) }}: + - task: UseDotNet@2 + displayName: Install .NET Core 6 SDK + inputs: + version: '6.0.424' + packageType: sdk + performMultiLevelLookup: true - script: ${{ variables.devCommand }} testl1 Debug ${{ parameters.os }}-${{ parameters.arch }} workingDirectory: src displayName: Functional tests From e87660195f6644addd8346b17e0c82ae2413fe04 Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Mon, 26 Aug 2024 16:43:43 +0400 Subject: [PATCH 33/51] Fixed strategy #3 --- .azure-pipelines/build-job.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.azure-pipelines/build-job.yml b/.azure-pipelines/build-job.yml index 40b85de667..e1ef59c4e1 100644 --- a/.azure-pipelines/build-job.yml +++ b/.azure-pipelines/build-job.yml @@ -79,11 +79,11 @@ jobs: pool: ${{ parameters.pool }} timeoutInMinutes: ${{ parameters.timeoutInMinutes }} strategy: - matrix: - NET6.0: - targetFramework: 'net6.0' - NET8.0: - targetFramework: 'net8.0' + matrix: + NET6.0: + targetFramework: 'net6.0' + NET8.0: + targetFramework: 'net8.0' ${{ if ne(parameters.container, '') }}: From e807d0f247c22ab438efe33e99e8f2285ec452ad Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Mon, 26 Aug 2024 16:54:34 +0400 Subject: [PATCH 34/51] Added target framework parameter for pipeline --- .azure-pipelines/build-job.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.azure-pipelines/build-job.yml b/.azure-pipelines/build-job.yml index e1ef59c4e1..d055167f74 100644 --- a/.azure-pipelines/build-job.yml +++ b/.azure-pipelines/build-job.yml @@ -157,7 +157,7 @@ jobs: - task: NuGetAuthenticate@1 # Build agent layout - - script: ${{ variables.devCommand }} layout Release ${{ parameters.os }}-${{ parameters.arch }} + - script: ${{ variables.devCommand }} layout $(targetFramework) Release ${{ parameters.os }}-${{ parameters.arch }} workingDirectory: src displayName: Build & Layout Release retryCountOnTaskFailure: 5 @@ -182,7 +182,7 @@ jobs: installationPath: 'C:\Program Files (x86)\dotnet' env: PROCESSOR_ARCHITECTURE: x86 - - script: ${{ variables.devCommand }} testl0 Debug ${{ parameters.os }}-${{ parameters.arch }} + - script: ${{ variables.devCommand }} testl0 $(targetFramework) Debug ${{ parameters.os }}-${{ parameters.arch }} workingDirectory: src displayName: Unit tests timeoutInMinutes: 5 @@ -196,7 +196,7 @@ jobs: version: '6.0.424' packageType: sdk performMultiLevelLookup: true - - script: ${{ variables.devCommand }} testl1 Debug ${{ parameters.os }}-${{ parameters.arch }} + - script: ${{ variables.devCommand }} testl1 $(targetFramework) Debug ${{ parameters.os }}-${{ parameters.arch }} workingDirectory: src displayName: Functional tests @@ -249,11 +249,11 @@ jobs: flavor: ${{ parameters.arch }} # Create agent package zip - - script: "${{ variables.devCommand }} package Release ${{ parameters.os }}-${{ parameters.arch }}" + - script: "${{ variables.devCommand }} package $(targetFramework) Release ${{ parameters.os }}-${{ parameters.arch }}" workingDirectory: src displayName: Package Release - - script: "${{ variables.devCommand }} hash Release ${{ parameters.os }}-${{ parameters.arch }}" + - script: "${{ variables.devCommand }} hash $(targetFramework) Release ${{ parameters.os }}-${{ parameters.arch }}" workingDirectory: src displayName: Hash Package From 95c461ddacc69e17b5cac7894f180c40c41faff3 Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Mon, 26 Aug 2024 17:53:13 +0400 Subject: [PATCH 35/51] Removed '-' to fix macos issue --- src/dev.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/dev.sh b/src/dev.sh index 5f8772938f..925f9859f8 100755 --- a/src/dev.sh +++ b/src/dev.sh @@ -10,11 +10,11 @@ set -eo pipefail # .NET version for agent build declare -A NET_VERSIONS=( - ["net6.0-sdk"]="6.0.424" - ["net6.0-runtime"]="6.0.32" + ["net6.0sdk"]="6.0.424" + ["net6.0runtime"]="6.0.32" - ["net8.0-sdk"]="8.0.401" - ["net8.0-runtime"]="8.0.8" + ["net8.0sdk"]="8.0.401" + ["net8.0runtime"]="8.0.8" ) ALL_ARGS=("$@") @@ -49,8 +49,8 @@ if [[ $TARGET_FRAMEWORK == "" ]]; then TARGET_FRAMEWORK=$DEFAULT_TARGET_FRAMEWORK fi -DOTNETSDK_VERSION=${NET_VERSIONS["${TARGET_FRAMEWORK}-sdk"]} -DOTNETRUNTIME_VERSION=${NET_VERSIONS["${TARGET_FRAMEWORK}-runtime"]} +DOTNETSDK_VERSION=${NET_VERSIONS["${TARGET_FRAMEWORK}sdk"]} +DOTNETRUNTIME_VERSION=${NET_VERSIONS["${TARGET_FRAMEWORK}runtime"]} if [[ ($DOTNETSDK_VERSION == "") || ($DOTNETRUNTIME_VERSION == "") ]]; then failed "Incorrect target framework is specified" From 28ee0bedfd6ea29e165d01f9720a84701e47c40c Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Mon, 26 Aug 2024 19:05:57 +0400 Subject: [PATCH 36/51] Macos fix #2 --- src/dev.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/dev.sh b/src/dev.sh index 925f9859f8..a0b94d364a 100755 --- a/src/dev.sh +++ b/src/dev.sh @@ -10,11 +10,11 @@ set -eo pipefail # .NET version for agent build declare -A NET_VERSIONS=( - ["net6.0sdk"]="6.0.424" - ["net6.0runtime"]="6.0.32" + ["net60-sdk"]="6.0.424" + ["net60-runtime"]="6.0.32" - ["net8.0sdk"]="8.0.401" - ["net8.0runtime"]="8.0.8" + ["net80-sdk"]="8.0.401" + ["net80-runtime"]="8.0.8" ) ALL_ARGS=("$@") @@ -49,8 +49,8 @@ if [[ $TARGET_FRAMEWORK == "" ]]; then TARGET_FRAMEWORK=$DEFAULT_TARGET_FRAMEWORK fi -DOTNETSDK_VERSION=${NET_VERSIONS["${TARGET_FRAMEWORK}sdk"]} -DOTNETRUNTIME_VERSION=${NET_VERSIONS["${TARGET_FRAMEWORK}runtime"]} +DOTNETSDK_VERSION=${NET_VERSIONS["${TARGET_FRAMEWORK//./}-sdk"]} +DOTNETRUNTIME_VERSION=${NET_VERSIONS["${TARGET_FRAMEWORK//./}-runtime"]} if [[ ($DOTNETSDK_VERSION == "") || ($DOTNETRUNTIME_VERSION == "") ]]; then failed "Incorrect target framework is specified" From 9685ae6cfa15d46671f3b06bf649efb758695278 Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Mon, 26 Aug 2024 19:15:26 +0400 Subject: [PATCH 37/51] Added debug infro --- src/dev.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dev.sh b/src/dev.sh index a0b94d364a..98cc3661c6 100755 --- a/src/dev.sh +++ b/src/dev.sh @@ -8,6 +8,8 @@ set -eo pipefail +echo $BASH_VERSION + # .NET version for agent build declare -A NET_VERSIONS=( ["net60-sdk"]="6.0.424" From 9a207380cac9618e992b30164120903d200b5800 Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Mon, 26 Aug 2024 19:36:58 +0400 Subject: [PATCH 38/51] Replaced a dictionary with a string to support Bash 3 --- src/dev.sh | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/dev.sh b/src/dev.sh index 98cc3661c6..2ec1cdd071 100755 --- a/src/dev.sh +++ b/src/dev.sh @@ -8,16 +8,13 @@ set -eo pipefail -echo $BASH_VERSION +# .NET version for agent build. +NET_VERSIONS= \ +"net6.0-sdk=6.0.424 + net6.0-runtime=6.0.32 -# .NET version for agent build -declare -A NET_VERSIONS=( - ["net60-sdk"]="6.0.424" - ["net60-runtime"]="6.0.32" - - ["net80-sdk"]="8.0.401" - ["net80-runtime"]="8.0.8" -) + net8.0-sdk=8.0.401 + net8.0-runtime=8.0.8" ALL_ARGS=("$@") DEV_CMD=$1 @@ -51,14 +48,18 @@ if [[ $TARGET_FRAMEWORK == "" ]]; then TARGET_FRAMEWORK=$DEFAULT_TARGET_FRAMEWORK fi -DOTNETSDK_VERSION=${NET_VERSIONS["${TARGET_FRAMEWORK//./}-sdk"]} -DOTNETRUNTIME_VERSION=${NET_VERSIONS["${TARGET_FRAMEWORK//./}-runtime"]} +function get_net_version () +{ + echo "$NET_VERSIONS" | grep -o "$1=[^ ]*" | cut -d '=' -f2 +} + +DOTNETSDK_VERSION=$(get_net_version "${TARGET_FRAMEWORK}-sdk") +DOTNETRUNTIME_VERSION=$(get_net_version "${TARGET_FRAMEWORK}-runtime") if [[ ($DOTNETSDK_VERSION == "") || ($DOTNETRUNTIME_VERSION == "") ]]; then failed "Incorrect target framework is specified" fi - DOTNETSDK_ROOT="${REPO_ROOT}/_dotnetsdk" DOTNETSDK_INSTALLDIR="$DOTNETSDK_ROOT/$DOTNETSDK_VERSION" From 83d59fc60953b0868f3510fc7a32a0294b57e0ab Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Mon, 26 Aug 2024 19:43:58 +0400 Subject: [PATCH 39/51] Minor fix --- src/dev.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dev.sh b/src/dev.sh index 2ec1cdd071..ccc960a59c 100755 --- a/src/dev.sh +++ b/src/dev.sh @@ -9,8 +9,8 @@ set -eo pipefail # .NET version for agent build. -NET_VERSIONS= \ -"net6.0-sdk=6.0.424 +NET_VERSIONS=" +net6.0-sdk=6.0.424 net6.0-runtime=6.0.32 net8.0-sdk=8.0.401 From 125319567f4216ae5a3653fd8659b82ae691e9d8 Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Mon, 26 Aug 2024 19:55:45 +0400 Subject: [PATCH 40/51] Added conditional compilation for VerificationException --- .../ValidationHelper/VerificationException.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Agent.Listener/ValidationHelper/VerificationException.cs b/src/Agent.Listener/ValidationHelper/VerificationException.cs index 77b0652b86..29a4ccb46c 100644 --- a/src/Agent.Listener/ValidationHelper/VerificationException.cs +++ b/src/Agent.Listener/ValidationHelper/VerificationException.cs @@ -18,5 +18,12 @@ public VerificationException(string message, Exception ex) : base(message, ex) { } + +#if NET6_0 + protected VerificationException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } +#endif } } From a0cd252251f1fee39ee912c8faa842e9d1c04446 Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Mon, 26 Aug 2024 19:58:41 +0400 Subject: [PATCH 41/51] Fixed L0 tests --- src/dir.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dir.proj b/src/dir.proj index 5d5d16f3b4..eee71ddb2a 100644 --- a/src/dir.proj +++ b/src/dir.proj @@ -79,7 +79,7 @@ - + From 53eeb426d4f2318018c93479a31df1e6ee7b7198 Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Mon, 26 Aug 2024 20:16:30 +0400 Subject: [PATCH 42/51] Fixed L1 --- src/dir.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dir.proj b/src/dir.proj index eee71ddb2a..8d8395eedb 100644 --- a/src/dir.proj +++ b/src/dir.proj @@ -101,7 +101,7 @@ Properties="Configuration=$(BUILDCONFIG);PackageRuntime=$(PackageRuntime);Version=1.0.0.0;RuntimeIdentifier=$(PackageRuntime);PublishDir=$(L1Root)/bin" /> - + From 1005c14e80e1224a3dbc2ad3037badf530e33331 Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Tue, 27 Aug 2024 01:06:23 +0400 Subject: [PATCH 43/51] Added 'target framework' parameter for the test proxty agent step. --- .azure-pipelines/pipeline.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/pipeline.yml b/.azure-pipelines/pipeline.yml index efe5230421..cb93ba6b15 100644 --- a/.azure-pipelines/pipeline.yml +++ b/.azure-pipelines/pipeline.yml @@ -102,6 +102,12 @@ extends: - ${{ if parameters.testProxyAgent }}: - job: test_proxy_agent displayName: Test Proxy Agent + strategy: + matrix: + NET6.0: + targetFramework: 'net6.0' + NET8.0: + targetFramework: 'net8.0' pool: name: 1ES-ABTT-Shared-Pool image: abtt-ubuntu-2204 @@ -120,12 +126,13 @@ extends: sourceBranch="$(Build.SourceBranch)" branch="${releaseBranch:-"${sourceBranch}"}" echo "Canary \"branch\" parameter: \"${branch}\"" + echo "Canary \"target_framework\" parameter: \"${targetframework}\"" node ./run-and-verify.js \ --projectUrl "$(CANARY_PROJECT_URL)" \ --pipelineId "$(CANARY_PIPELINE_ID)" \ --token "$(ACCESS_TOKEN)" \ - --templateParameters "{ \"branch\": \"${branch}\" }" + --templateParameters "{ \"branch\": \"${branch}\", \"target_framework\": \"${targetFramework}\"}" displayName: Test Proxy Agent # Windows (x64) From e255cfeb4dd7d4cea7537a90ad986078d429b5c1 Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Tue, 27 Aug 2024 01:25:53 +0400 Subject: [PATCH 44/51] Fixed var name --- .azure-pipelines/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/pipeline.yml b/.azure-pipelines/pipeline.yml index cb93ba6b15..3c7641a741 100644 --- a/.azure-pipelines/pipeline.yml +++ b/.azure-pipelines/pipeline.yml @@ -126,7 +126,7 @@ extends: sourceBranch="$(Build.SourceBranch)" branch="${releaseBranch:-"${sourceBranch}"}" echo "Canary \"branch\" parameter: \"${branch}\"" - echo "Canary \"target_framework\" parameter: \"${targetframework}\"" + echo "Canary \"target_framework\" parameter: \"${targetFramework}\"" node ./run-and-verify.js \ --projectUrl "$(CANARY_PROJECT_URL)" \ From 0f8ef5a1bfbe0e6946a1dfbce694724bf9c793fc Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Tue, 27 Aug 2024 01:44:09 +0400 Subject: [PATCH 45/51] Add test branch to test proxy agent job --- .azure-pipelines/scripts/run-and-verify.js | 1 + 1 file changed, 1 insertion(+) diff --git a/.azure-pipelines/scripts/run-and-verify.js b/.azure-pipelines/scripts/run-and-verify.js index 712727c49a..07552884e0 100644 --- a/.azure-pipelines/scripts/run-and-verify.js +++ b/.azure-pipelines/scripts/run-and-verify.js @@ -22,6 +22,7 @@ const data = {}; if (args.templateParameters) { data.templateParameters = JSON.parse(args.templateParameters); + data.resources = '{"repositories":{"self":{"refName":"refs/heads/users/v-dennikulin/add-target-framework"}}}' } const config = { From 75d9f96edc1b770d70c16b5e5ed64a798c996e91 Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Tue, 27 Aug 2024 02:00:45 +0400 Subject: [PATCH 46/51] Fixed var --- .azure-pipelines/pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/pipeline.yml b/.azure-pipelines/pipeline.yml index 3c7641a741..1929f19846 100644 --- a/.azure-pipelines/pipeline.yml +++ b/.azure-pipelines/pipeline.yml @@ -126,13 +126,13 @@ extends: sourceBranch="$(Build.SourceBranch)" branch="${releaseBranch:-"${sourceBranch}"}" echo "Canary \"branch\" parameter: \"${branch}\"" - echo "Canary \"target_framework\" parameter: \"${targetFramework}\"" + echo "Canary \"target_framework\" parameter: \"$(targetFramework)\"" node ./run-and-verify.js \ --projectUrl "$(CANARY_PROJECT_URL)" \ --pipelineId "$(CANARY_PIPELINE_ID)" \ --token "$(ACCESS_TOKEN)" \ - --templateParameters "{ \"branch\": \"${branch}\", \"target_framework\": \"${targetFramework}\"}" + --templateParameters "{ \"branch\": \"${branch}\", \"target_framework\": \"$(targetFramework)\"}" displayName: Test Proxy Agent # Windows (x64) From 2bbe7072883e0c22e6f0b49e06d5b444b5185df9 Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Tue, 27 Aug 2024 12:09:27 +0400 Subject: [PATCH 47/51] Reverted changes in run-and-verify.js --- .azure-pipelines/scripts/run-and-verify.js | 1 - 1 file changed, 1 deletion(-) diff --git a/.azure-pipelines/scripts/run-and-verify.js b/.azure-pipelines/scripts/run-and-verify.js index 07552884e0..712727c49a 100644 --- a/.azure-pipelines/scripts/run-and-verify.js +++ b/.azure-pipelines/scripts/run-and-verify.js @@ -22,7 +22,6 @@ const data = {}; if (args.templateParameters) { data.templateParameters = JSON.parse(args.templateParameters); - data.resources = '{"repositories":{"self":{"refName":"refs/heads/users/v-dennikulin/add-target-framework"}}}' } const config = { From 6ab68ac00362f9db6e35fac7a1c97b2a9e88d738 Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Wed, 4 Sep 2024 11:54:32 +0400 Subject: [PATCH 48/51] Added changes to release pipeline --- .azure-pipelines/build-job.yml | 18 ++++++++++++------ .azure-pipelines/build-jobs.yml | 8 +++++++- .azure-pipelines/pipeline.yml | 31 +++++++++++++++++++++++++------ .vsts.release.yml | 15 +++++++++++++++ src/dev.sh | 6 +++--- 5 files changed, 62 insertions(+), 16 deletions(-) diff --git a/.azure-pipelines/build-job.yml b/.azure-pipelines/build-job.yml index d055167f74..02c5233de2 100644 --- a/.azure-pipelines/build-job.yml +++ b/.azure-pipelines/build-job.yml @@ -13,6 +13,9 @@ parameters: - name: container type: string +- name: targetFramework + type: string + - name: timeoutInMinutes type: number @@ -78,12 +81,13 @@ jobs: displayName: ${{ parameters.displayName }} pool: ${{ parameters.pool }} timeoutInMinutes: ${{ parameters.timeoutInMinutes }} - strategy: - matrix: - NET6.0: - targetFramework: 'net6.0' - NET8.0: - targetFramework: 'net8.0' + ${{ if eq(parameters.targetFramework, 'all') }}: + strategy: + matrix: + NET6.0: + targetFramework: 'net6.0' + NET8.0: + targetFramework: 'net8.0' ${{ if ne(parameters.container, '') }}: @@ -107,6 +111,8 @@ jobs: DisableDockerDetector: true nugetMultiFeedWarnLevel: none CheckoutBranch: ${{ parameters.branch }} + ${{ if ne(parameters.targetFramework, 'all') }}: + targetFramework: ${{ parameters.targetFramework }} templateContext: outputs: - ${{ if or(parameters.unitTests, parameters.functionalTests) }}: diff --git a/.azure-pipelines/build-jobs.yml b/.azure-pipelines/build-jobs.yml index 22d58112b9..add106e7a5 100644 --- a/.azure-pipelines/build-jobs.yml +++ b/.azure-pipelines/build-jobs.yml @@ -15,6 +15,10 @@ parameters: type: string default: '' +- name: targetFramework + type: string + default: 'all' + - name: timeoutInMinutes type: number default: 120 @@ -81,6 +85,7 @@ jobs: verifySigning: ${{ parameters.verifySigning }} publishArtifact: ${{ parameters.publishArtifacts }} packageType: agent + targetFramework: ${{ parameters.targetFramework }} - ${{ if parameters.buildAlternatePackage }}: - template: /.azure-pipelines/build-job.yml@self @@ -99,4 +104,5 @@ jobs: sign: ${{ parameters.sign }} verifySigning: ${{ parameters.verifySigning }} publishArtifact: ${{ parameters.publishArtifacts }} - packageType: pipelines-agent \ No newline at end of file + packageType: pipelines-agent + targetFramework: ${{ parameters.targetFramework }} \ No newline at end of file diff --git a/.azure-pipelines/pipeline.yml b/.azure-pipelines/pipeline.yml index 1929f19846..393eea41eb 100644 --- a/.azure-pipelines/pipeline.yml +++ b/.azure-pipelines/pipeline.yml @@ -1,6 +1,13 @@ # This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool. # This pipeline will be extended to the OneESPT template parameters: +- name: targetFramework + type: string + default: all + values: + - all + - net6.0 + - net8.0 - name: preBuildStages type: stageList default: [] @@ -102,12 +109,13 @@ extends: - ${{ if parameters.testProxyAgent }}: - job: test_proxy_agent displayName: Test Proxy Agent - strategy: - matrix: - NET6.0: - targetFramework: 'net6.0' - NET8.0: - targetFramework: 'net8.0' + ${{ if eq(parameters.targetFramework, 'all') }}: + strategy: + matrix: + NET6.0: + targetFramework: 'net6.0' + NET8.0: + targetFramework: 'net8.0' pool: name: 1ES-ABTT-Shared-Pool image: abtt-ubuntu-2204 @@ -115,6 +123,8 @@ extends: variables: DisableDockerDetector: true nugetMultiFeedWarnLevel: none + ${{ if ne(parameters.targetFramework, 'all') }}: + targetFramework: ${{ parameters.targetFramework }} timeoutInMinutes: 300 steps: - template: /.azure-pipelines/get-pat.yml@self @@ -155,6 +165,7 @@ extends: verifySigning: ${{ parameters.sign }} publishArtifacts: ${{ parameters.publishArtifacts }} buildAlternatePackage: ${{ parameters.buildAlternatePackage }} + targetFramework: ${{ parameters.targetFramework }} # Windows (x86) - ${{ if parameters.win_x86 }}: @@ -174,6 +185,7 @@ extends: sign: ${{ parameters.sign }} publishArtifacts: ${{ parameters.publishArtifacts }} buildAlternatePackage: ${{ parameters.buildAlternatePackage }} + targetFramework: ${{ parameters.targetFramework }} # Linux (x64) - ${{ if parameters.linux_x64 }}: @@ -193,6 +205,7 @@ extends: sign: ${{ parameters.sign }} publishArtifacts: ${{ parameters.publishArtifacts }} buildAlternatePackage: ${{ parameters.buildAlternatePackage }} + targetFramework: ${{ parameters.targetFramework }} # Linux (ARM) - ${{ if parameters.linux_arm }}: @@ -213,6 +226,7 @@ extends: sign: false publishArtifacts: ${{ parameters.publishArtifacts }} buildAlternatePackage: ${{ parameters.buildAlternatePackage }} + targetFramework: ${{ parameters.targetFramework }} # Linux (ARM64) - ${{ if parameters.linux_arm64 }}: @@ -233,6 +247,7 @@ extends: sign: false publishArtifacts: ${{ parameters.publishArtifacts }} buildAlternatePackage: ${{ parameters.buildAlternatePackage }} + targetFramework: ${{ parameters.targetFramework }} # Alpine (x64) - ${{ if parameters.alpine_x64 }}: @@ -253,6 +268,7 @@ extends: sign: false publishArtifacts: ${{ parameters.publishArtifacts }} buildAlternatePackage: false + targetFramework: ${{ parameters.targetFramework }} # Alpine (ARM64) - ${{ if parameters.alpine_arm64 }}: @@ -273,6 +289,7 @@ extends: sign: false publishArtifacts: ${{ parameters.publishArtifacts }} buildAlternatePackage: false + targetFramework: ${{ parameters.targetFramework }} # macOS (x64) - ${{ if parameters.macOS_x64 }}: @@ -293,6 +310,7 @@ extends: sign: ${{ parameters.sign }} publishArtifacts: ${{ parameters.publishArtifacts }} buildAlternatePackage: ${{ parameters.buildAlternatePackage }} + targetFramework: ${{ parameters.targetFramework }} # macOS (ARM64) - ${{ if parameters.macOS_arm64 }}: @@ -313,4 +331,5 @@ extends: sign: ${{ parameters.sign }} publishArtifacts: ${{ parameters.publishArtifacts }} buildAlternatePackage: ${{ parameters.buildAlternatePackage }} + targetFramework: ${{ parameters.targetFramework }} - ${{ parameters.postBuildStages }} \ No newline at end of file diff --git a/.vsts.release.yml b/.vsts.release.yml index 99191216d0..3c43cf288a 100644 --- a/.vsts.release.yml +++ b/.vsts.release.yml @@ -31,6 +31,13 @@ parameters: type: string displayName: Version default: 'NotSet' +- name: targetFramework + displayName: Target framework + type: string + default: net6.0 + values: + - net6.0 + - net8.0 - name: derivedFrom type: string displayName: Derived From Version @@ -73,6 +80,7 @@ extends: test: ${{ not(parameters.skipTests) }} sign: true publishArtifacts: true + targetFramework: ${{ parameters.targetFramework }} testProxyAgent: ${{ parameters.testProxyAgent }} stageDependencies: - Verify_release @@ -138,6 +146,13 @@ extends: if ($agentVersion -eq 'NotSet') { Write-Error "Version parameter is required for manual release." -ErrorAction Stop } + + ## Verify target framework for specified version + $majorVersion = $agentVersion.Split('.')[0] + if (${{ parameters.targetFramework }} -eq "net6.0" -and $majorVersion -ne "3") -or + (${{ parameters.targetFramework }} -eq "net8.0" -and $majorVersion -ne "4") { + Write-Error "The major version should be 3 for net6.0 and 4 for net8.0" -ErrorAction Stop + } } if ($isTestRun) { $agentVersion = '3.000.999' diff --git a/src/dev.sh b/src/dev.sh index ccc960a59c..96a4c90b99 100755 --- a/src/dev.sh +++ b/src/dev.sh @@ -11,10 +11,10 @@ set -eo pipefail # .NET version for agent build. NET_VERSIONS=" net6.0-sdk=6.0.424 - net6.0-runtime=6.0.32 +net6.0-runtime=6.0.32 - net8.0-sdk=8.0.401 - net8.0-runtime=8.0.8" +net8.0-sdk=8.0.401 +net8.0-runtime=8.0.8" ALL_ARGS=("$@") DEV_CMD=$1 From 1ce83224f936f51794cf9228c61109d7a2186c5f Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Wed, 4 Sep 2024 12:18:04 +0400 Subject: [PATCH 49/51] Removed unnecessary values --- .azure-pipelines/build-jobs.yml | 1 - .azure-pipelines/pipeline.yml | 4 ---- 2 files changed, 5 deletions(-) diff --git a/.azure-pipelines/build-jobs.yml b/.azure-pipelines/build-jobs.yml index add106e7a5..9ad597440f 100644 --- a/.azure-pipelines/build-jobs.yml +++ b/.azure-pipelines/build-jobs.yml @@ -17,7 +17,6 @@ parameters: - name: targetFramework type: string - default: 'all' - name: timeoutInMinutes type: number diff --git a/.azure-pipelines/pipeline.yml b/.azure-pipelines/pipeline.yml index 393eea41eb..cdb2d004ce 100644 --- a/.azure-pipelines/pipeline.yml +++ b/.azure-pipelines/pipeline.yml @@ -4,10 +4,6 @@ parameters: - name: targetFramework type: string default: all - values: - - all - - net6.0 - - net8.0 - name: preBuildStages type: stageList default: [] From 91eddff4c602a5f924751b0f16ad64b019722900 Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Wed, 4 Sep 2024 12:21:36 +0400 Subject: [PATCH 50/51] Fixed condition. --- .vsts.release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.vsts.release.yml b/.vsts.release.yml index 9945d4ee9e..4ceeb2eefa 100644 --- a/.vsts.release.yml +++ b/.vsts.release.yml @@ -149,8 +149,8 @@ extends: ## Verify target framework for specified version $majorVersion = $agentVersion.Split('.')[0] - if (${{ parameters.targetFramework }} -eq "net6.0" -and $majorVersion -ne "3") -or - (${{ parameters.targetFramework }} -eq "net8.0" -and $majorVersion -ne "4") { + if ((${{ parameters.targetFramework }} -eq "net6.0" -and $majorVersion -ne "3") -or + (${{ parameters.targetFramework }} -eq "net8.0" -and $majorVersion -ne "4")) { Write-Error "The major version should be 3 for net6.0 and 4 for net8.0" -ErrorAction Stop } } From d7d5b52df0c651d68ffb62f881b1cbf6be8306d1 Mon Sep 17 00:00:00 2001 From: "Denis Nikulin (Akvelon Inc)" Date: Wed, 4 Sep 2024 15:26:24 +0400 Subject: [PATCH 51/51] Removed log changes for L1 tests. --- src/Test/L1/Worker/L1TestBase.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Test/L1/Worker/L1TestBase.cs b/src/Test/L1/Worker/L1TestBase.cs index 3f3867742f..db9327fd21 100644 --- a/src/Test/L1/Worker/L1TestBase.cs +++ b/src/Test/L1/Worker/L1TestBase.cs @@ -33,7 +33,6 @@ public class TestResults public class L1TestBase : IDisposable { - private static readonly string NetVersionFolder = "net" + $"{Environment.Version.Major}"; protected TimeSpan ChannelTimeout = TimeSpan.FromSeconds(100); protected TimeSpan JobTimeout = TimeSpan.FromSeconds(100); @@ -278,7 +277,8 @@ private string GetLogFile(object testClass, string testMethod) startIndex: typeof(Tests.TestHostContext).FullName.LastIndexOf(nameof(TestHostContext))); var testName = testMethod.Replace(".", "_"); - return Path.Combine(TestUtil.GetSrcPath(), "Test", "TestLogs", NetVersionFolder, + return Path.Combine( + Path.Combine(TestUtil.GetSrcPath(), "Test", "TestLogs"), $"trace_{suiteName}_{testName}.log"); }