Skip to content

Commit

Permalink
Enabling functional tests, take 2 (#306)
Browse files Browse the repository at this point in the history
* Enabling functional tests, take 2

* Adding missing nuget package

* Trying the beta selenium driver

* Newtonsoft

* Trying functional test tweak

* Tweaked build file
  • Loading branch information
samsmithnz authored Apr 3, 2021
1 parent 240587e commit d0de12a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/aspnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,26 @@ jobs:
with:
dotnet-version: ${{ env.dotNetSDKVersion }}

#Publish dotnet objects
#Publish web and web service projects
- name: DotNet Publish Web Service
run: dotnet publish FeatureFlags/FeatureFlags.Service/FeatureFlags.Service.csproj --configuration ${{ env.dotNetConfiguration }} -p:Version=${{ steps.gitversion.outputs.nuGetVersionV2 }} --output ${{ github.workspace }}/webservice --runtime ${{env.runtimeTarget}} --self-contained false # --self-contained true --runtime ${{env.runtimeTarget}}
- name: DotNet Publish Web Site
run: dotnet publish FeatureFlags/FeatureFlags.Web/FeatureFlags.Web.csproj --configuration ${{ env.dotNetConfiguration }} -p:Version=${{ steps.gitversion.outputs.nuGetVersionV2 }} --output ${{ github.workspace }}/web --runtime ${{env.runtimeTarget}} --self-contained false # --self-contained true --runtime ${{env.runtimeTarget}}

#Publish functional tests
- name: DotNet build functional tests
run: dotnet build FeatureFlags/FeatureFlags.FunctionalTests/FeatureFlags.FunctionalTests.csproj --configuration ${{ env.dotNetConfiguration }} --runtime ${{env.runtimeTarget}} #--self-contained false #--self-contained true --runtime ${{env.runtimeTarget}}
- name: DotNet Publish functional tests
run: dotnet publish FeatureFlags/FeatureFlags.FunctionalTests/FeatureFlags.FunctionalTests.csproj --configuration ${{ env.dotNetConfiguration }} --output ${{ github.workspace }}/functionalTests --runtime ${{env.runtimeTarget}} --self-contained false # --self-contained true --runtime ${{env.runtimeTarget}}
- name: Copy chromedriver for functional test
run: copy "FeatureFlags/FeatureFlags.FunctionalTests/bin/${{ env.dotNetConfiguration }}/${{ env.dotNetVersion }}/${{env.runtimeTarget}}/chromedriver.exe" "${{ github.workspace }}/functionalTests"
shell: powershell
- name: DotNet restore functional tests to get correct NewtonSoft version
run: dotnet restore FeatureFlags/FeatureFlags.FunctionalTests/FeatureFlags.FunctionalTests.csproj
- name: Copy new NewtonSoft version for functional test
run: copy "FeatureFlags/FeatureFlags.FunctionalTests/bin/${{ env.dotNetConfiguration }}/${{ env.dotNetVersion }}/${{env.runtimeTarget}}/Newtonsoft.Json.dll" "${{ github.workspace }}/functionalTests"
shell: powershell


#Publish build artifacts to GitHub
- name: Upload web service build artifacts back to GitHub
Expand Down Expand Up @@ -92,6 +100,7 @@ jobs:
- name: Build automated tests project
run: dotnet build FeatureFlags/FeatureFlags.Tests/FeatureFlags.Tests.csproj --configuration ${{ env.dotNetConfiguration }}
- name: Create empty file to get around error in .NET 6
if: 0 == 1
run: |
#Create the secrets.json file
New-Item FeatureFlags\FeatureFlags.Tests\secrets.json
Expand Down Expand Up @@ -145,7 +154,8 @@ jobs:
app-name: featureflags-data-eu-service
package: serviceapp
slot-name: staging
- run: az webapp config appsettings set --name "featureflags-data-eu-service" --resource-group "SamLearnsAzureFeatureFlags" --slot staging --settings "AppSettings:ClientSecret=${{ secrets.ClientSecret }}"
- name: Set service secrets
run: az webapp config appsettings set --name "featureflags-data-eu-service" --resource-group "SamLearnsAzureFeatureFlags" --slot staging --settings "AppSettings:ClientSecret=${{ secrets.ClientSecret }}"
- name: Deploy website to Azure WebApp
uses: Azure/webapps-deploy@v1
with:
Expand All @@ -155,7 +165,7 @@ jobs:

# Run functional tests on staging slots
- name: Functional Tests
if: 0 == 1
if: 1 == 1
run: |
$vsTestConsoleExe = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\TestPlatform\\vstest.console.exe"
$targetTestDll = "functionaltests\FeatureFlags.FunctionalTests.dll"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Selenium.WebDriver" Version="3.141.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Selenium.WebDriver" Version="4.0.0-beta2" />
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="89.0.4389.2300" />
</ItemGroup>

Expand Down

0 comments on commit d0de12a

Please sign in to comment.