Skip to content

User/snamilikonda/1espt 2 #525

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 153 additions & 0 deletions .azurepipelines/azure-pipelines-1ES.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
trigger: none
pr: none
resources:
repositories:
- repository: 1ESPipelineTemplates
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
extends:
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
parameters:
sdl:
codeql:
${{ if eq(variables['Build.SourceBranch'], variables['AllowedBranch']) }}:
enabledOnNonDefaultBranches: true
pool:
name: Azure-Pipelines-1ESPT-ExDShared
image: windows-2022
os: windows
stages:
- stage: stage
jobs:
- job: Build_PowerAppsTestEngine
displayName: 'Build PowerAppsTestEngine Solution'
strategy:
matrix:
Debug:
BuildConfiguration: 'Debug'
Release:
BuildConfiguration: 'Release'
templateContext:
outputs:
- output: pipelineArtifact
condition: and(succeeded(), eq(variables['BuildConfiguration'], 'Release'))
artifactName: 'PowerApps.TestEngine ($(BuildConfiguration))'
targetPath: '$(Build.ArtifactStagingDirectory)'
- output: nuget
condition: and(succeeded(), eq(variables['BuildConfiguration'], 'Release'), eq(variables['UpdateVer'], 'true'))
useDotNetTask: false # The default is false to use the NuGetCommand task. Set to true to use the DotNetCoreCLI task to publish packages.
packagesToPush: '$(Build.ArtifactStagingDirectory)/Microsoft.PowerApps.TestEngine.*.nupkg'
packageParentPath: '$(Build.ArtifactStagingDirectory)'
publishVstsFeed: $(InternalFeed)
nuGetFeedType: internal
allowPackageConflicts: true # Optional. NuGetCommand task only.
steps:
- script: |
echo "Hello $(myVariable)"
- task: UseDotNet@2
displayName: 'Use dotnet sdk 8.0'
inputs:
version: 8.0.x
installationPath: '$(Agent.ToolsDirectory)/dotnet'
- task: DotNetCoreCLI@2
displayName: 'Build and test'
inputs:
command: 'run'
projects: '$(Build.SourcesDirectory)/targets/targets.csproj'
arguments: '-- ci -c $(BuildConfiguration)'
- task: PublishTestResults@2
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: '**/*-*.trx'
searchFolder: '$(Build.SourcesDirectory)/obj/'
mergeTestResults: true
failTaskOnFailedTests: true
- task: EsrpCodeSigning@5
displayName: 'ESRP sign'
condition: and(succeeded(), eq(variables['BuildConfiguration'], 'Release'))
inputs:
ConnectedServiceName: $(EsrpConServName)
AppRegistrationClientId: $(EsrpAppRegCliId)
AppRegistrationTenantId: $(EsrpAppRegTenId)
AuthAKVName: $(EsrpKVName)
AuthCertName: $(EsrpAuthCertName)
AuthSignCertName: $(EsrpAuthSignCertName)
FolderPath: '$(Build.SourcesDirectory)/bin/$(BuildConfiguration)/PowerAppsTestEngine/'
Pattern: '*.dll'
signConfigType: inlineSignParams
inlineOperation: |
[
{
"KeyCode": "CP-233863-SN",
"OperationCode": "StrongNameSign",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
},
{
"KeyCode": "CP-233863-SN",
"OperationCode": "StrongNameVerify",
"ToolName": "sign",
"ToolVersion": "1.0",
"Parameters": {}
},
{
"KeyCode": "CP-230012",
"OperationCode": "SigntoolSign",
"Parameters": {
"OpusName": "Microsoft",
"OpusInfo": "http://www.microsoft.com",
"Append": "/as",
"FileDigest": "/fd \"SHA256\"",
"PageHash": "/NPH",
"TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
},
"ToolName": "sign",
"ToolVersion": "1.0"
},
{
"KeyCode": "CP-230012",
"OperationCode": "SigntoolVerify",
"ToolName": "sign",
"ToolVersion": "1.0",
"Parameters": {}
}
]
- task: DotNetCoreCLI@2
displayName: 'Pack'
inputs:
command: 'run'
projects: '$(Build.SourcesDirectory)/targets/targets.csproj'
arguments: '-- pack-AlphaV2 -c $(BuildConfiguration) -o $(Build.ArtifactStagingDirectory)'
condition: and(succeeded(), eq(variables['BuildConfiguration'], 'Release'))
- task: EsrpCodeSigning@5
displayName: 'ESRP sign nuget packages'
inputs:
ConnectedServiceName: $(EsrpConServName)
AppRegistrationClientId: $(EsrpAppRegCliId)
AppRegistrationTenantId: $(EsrpAppRegTenId)
AuthAKVName: $(EsrpKVName)
AuthCertName: $(EsrpAuthCertName)
AuthSignCertName: $(EsrpAuthSignCertName)
FolderPath: '$(Build.ArtifactStagingDirectory)'
Pattern: '*.nupkg'
signConfigType: inlineSignParams
inlineOperation: |
[
{
"KeyCode": "CP-401405",
"OperationCode": "NuGetSign",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
},
{
"KeyCode": "CP-401405",
"OperationCode": "NuGetVerify",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
}
]
condition: and(succeeded(), eq(variables['BuildConfiguration'], 'Release'))
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
Expand Down Expand Up @@ -42,14 +42,14 @@
<PackageReference Include="ICSharpCode.Decompiler" Version="8.2.0.7535" />
<!-- Pin to 5.8.4 as version 5.8.5 is depricated -->
<PackageReference Include="Microsoft.Data.OData" Version="5.8.4" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Playwright" Version="1.48.0" />
<PackageReference Include="Microsoft.PowerFx.Interpreter" Version="1.2.0" />
<PackageReference Include="Mono.Cecil" Version="0.11.6" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NuGet.Configuration" Version="6.11.1" />
<PackageReference Include="System.ComponentModel.Composition" Version="8.0.0" />
<PackageReference Include="System.ComponentModel.Composition" Version="5.0.0" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
<PackageReference Include="YamlDotNet" Version="16.1.3" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.PowerApps.TestEngine/TestEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public TestEngine(ITestState state,
/// <param name="queryParams">Optional query parameters that would be passed to the Player URL for optional features or parameters.</param>
/// <returns>The full path where the test results are saved.</returns>
/// <exception cref="ArgumentNullException">Throws ArgumentNullException if any of testConfigFile, environmentId, tenantId or domain are missing or empty.</exception>
public async Task<string> RunTestAsync(FileInfo testConfigFile, string environmentId, Guid tenantId, DirectoryInfo outputDirectory, string domain, string queryParams)
public async Task<string> RunTestAsync(FileInfo testConfigFile, string environmentId, Guid? tenantId, DirectoryInfo outputDirectory, string domain, string queryParams)
{
// Set up test reporting
var testRunId = _testReporter.CreateTestRun("Power Fx Test Runner", "User"); // TODO: determine if there are more meaningful values we can put here
Expand Down
74 changes: 69 additions & 5 deletions src/PowerAppsTestEngine/PowerAppsTestEngine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
Expand All @@ -24,14 +24,78 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
<PackageReference Include="System.ComponentModel.Composition" Version="8.0.0" />
<PackageReference Include="ICSharpCode.Decompiler" Version="8.2.0.7535" />
<PackageReference Include="Microsoft.Data.OData" Version="5.8.4" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Playwright" Version="1.48.0" />
<PackageReference Include="Microsoft.PowerFx.Interpreter" Version="1.2.0" />
<PackageReference Include="Mono.Cecil" Version="0.11.6" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NuGet.Configuration" Version="6.11.1" />
<PackageReference Include="System.ComponentModel.Composition" Version="5.0.0" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
<PackageReference Include="YamlDotNet" Version="16.1.3" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Scripting" Version="4.5.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.5.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Microsoft.PowerApps.TestEngine\Microsoft.PowerApps.TestEngine.csproj" />
<ProjectReference Include="..\Microsoft.PowerApps.TestEngine\Microsoft.PowerApps.TestEngine.csproj" PrivateAssets="all" />
<ProjectReference Include="..\testengine.auth.certificatestore\testengine.auth.certificatestore.csproj" PrivateAssets="all" />
<ProjectReference Include="..\testengine.common.user\testengine.common.user.csproj" PrivateAssets="all" />
<ProjectReference Include="..\testengine.module.mda\testengine.module.mda.csproj" PrivateAssets="all" />
<ProjectReference Include="..\testengine.module.pause\testengine.module.pause.csproj" PrivateAssets="all" />
<ProjectReference Include="..\testengine.module.playwrightaction\testengine.module.playwrightaction.csproj" PrivateAssets="all" />
<ProjectReference Include="..\testengine.module.playwrightscript\testengine.module.playwrightscript.csproj" PrivateAssets="all" />
<ProjectReference Include="..\testengine.module.powerapps.portal\testengine.module.powerapps.portal.csproj" PrivateAssets="all" />
<ProjectReference Include="..\testengine.module.sample\testengine.module.sample.csproj" PrivateAssets="all" />
<ProjectReference Include="..\testengine.module.simulation\testengine.module.simulation.csproj" PrivateAssets="all" />
<ProjectReference Include="..\testengine.provider.canvas\testengine.provider.canvas.csproj" PrivateAssets="all" />
<ProjectReference Include="..\testengine.provider.mda\testengine.provider.mda.csproj" PrivateAssets="all" />
<ProjectReference Include="..\testengine.provider.powerapps.portal\testengine.provider.powerapps.portal.csproj" PrivateAssets="all" />
<ProjectReference Include="..\testengine.user.storagestate\testengine.user.storagestate.csproj" PrivateAssets="all" />
</ItemGroup>

<!-- Nuget Properties -->
<PropertyGroup>
<Authors>Microsoft</Authors>
<Company>crmsdk,Microsoft</Company>
<Title>Microsoft.PowerApps.TestEngine</Title>
<Description>Alpha Release: Providing makers with a single automated testing platform for all Power Apps apps</Description>
<PackageReleaseNotes>
Notice:
This package is an ALPHA release. - Use at your own risk.

Intial Alpha release of Microsoft.PowerAppsTestEngine
</PackageReleaseNotes>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<MinVerMinimumMajorMinor>1.0</MinVerMinimumMajorMinor>
</PropertyGroup>

<PropertyGroup>
<IncludeBuildOutput>false</IncludeBuildOutput>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
</PropertyGroup>

<ItemGroup Condition="'$(GitExists)' == true">
<PackageReference Include="MinVer" Version="2.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ExcludedAssemblies Include="..\..\bin\$(configuration)\PowerAppsTestEngine\PowerAppsTestEngine.dll" />
<FilesToPack Include="..\..\bin\$(configuration)\PowerAppsTestEngine\*.dll" Exclude="@(ExcludedAssemblies)" />
<None Include="@(FilesToPack)">
<Pack>true</Pack>
<PackagePath>lib\$(TargetFramework)\</PackagePath>
</None>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
Expand Down Expand Up @@ -32,9 +32,5 @@
<ProjectReference Include="..\Microsoft.PowerApps.TestEngine\Microsoft.PowerApps.TestEngine.csproj" />
</ItemGroup>

<Target Name="CopyFiles" AfterTargets="AfterBuild">
<Copy SourceFiles="@(MySourceFiles)" DestinationFolder="..\..\bin\$(configuration)\PowerAppsTestEngine" />
</Target>

</Project>

4 changes: 2 additions & 2 deletions src/testengine.common.user/LoginState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class LoginState
public string? MatchHost { get; set; }


public Func<string, Task>? CallbackDesiredUrlFound { get; set; }
public Func<Task>? CallbackErrorFound { get; set; }
public Func<string, Task> CallbackDesiredUrlFound { get; set; } = null;
public Func<Task> CallbackErrorFound { get; set; } = null;
}
}
2 changes: 1 addition & 1 deletion src/testengine.common.user/PowerPlatformLogin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public virtual async Task HandleCommonLoginState(LoginState state)
{
if (!state.Module.Settings.ContainsKey(ERROR_DIALOG_KEY))
{
state.Module.Settings.TryAdd(ERROR_DIALOG_KEY, title);
state.Module.Settings.Add(ERROR_DIALOG_KEY, title);
}
else
{
Expand Down
6 changes: 1 addition & 5 deletions src/testengine.common.user/testengine.common.user.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down Expand Up @@ -37,8 +37,4 @@
<MySourceFiles Include="..\..\bin\$(configuration)\testengine.common.user\testengine.common.user.dll" />
</ItemGroup>

<Target Name="CopyFiles" AfterTargets="AfterBuild">
<Copy SourceFiles="@(MySourceFiles)" DestinationFolder="..\..\bin\$(configuration)\PowerAppsTestEngine" />
</Target>

</Project>
9 changes: 3 additions & 6 deletions src/testengine.module.mda/testengine.module.mda.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Authors>Microsoft</Authors>
Expand Down Expand Up @@ -40,10 +40,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Playwright" Version="1.48.0" />
<PackageReference Include="Microsoft.PowerFx.Interpreter" Version="1.2.0" />
<PackageReference Include="System.ComponentModel.Composition" Version="8.0.0" />
<PackageReference Include="System.ComponentModel.Composition" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
Expand All @@ -54,7 +54,4 @@
<MySourceFiles Include="..\..\bin\$(configuration)\testengine.module.mda\testengine.module.mda.dll" />
</ItemGroup>

<Target Name="CopyFiles" AfterTargets="AfterBuild">
<Copy SourceFiles="@(MySourceFiles)" DestinationFolder="..\..\bin\$(configuration)\PowerAppsTestEngine" />
</Target>
</Project>
9 changes: 3 additions & 6 deletions src/testengine.module.pause/testengine.module.pause.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Authors>Microsoft</Authors>
Expand Down Expand Up @@ -40,10 +40,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Playwright" Version="1.48.0" />
<PackageReference Include="Microsoft.PowerFx.Interpreter" Version="1.2.0" />
<PackageReference Include="System.ComponentModel.Composition" Version="8.0.0" />
<PackageReference Include="System.ComponentModel.Composition" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
Expand All @@ -54,7 +54,4 @@
<MySourceFiles Include="..\..\bin\$(configuration)\testengine.module.pause\testengine.module.pause.dll" />
</ItemGroup>

<Target Name="CopyFiles" AfterTargets="AfterBuild">
<Copy SourceFiles="@(MySourceFiles)" DestinationFolder="..\..\bin\$(configuration)\PowerAppsTestEngine" />
</Target>
</Project>
Loading
Loading