From 7bacde0e3d0bc130590d7d0d954808a63f3dc833 Mon Sep 17 00:00:00 2001 From: Apollo3zehn Date: Sat, 2 Mar 2024 23:54:44 +0100 Subject: [PATCH] Fix tests --- .editorconfig | 3 +++ .github/workflows/build-and-publish.yml | 14 +++++++------- src/Nexus/Services/DataService.cs | 5 ++--- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.editorconfig b/.editorconfig index 0ccff01d..32c8ff96 100755 --- a/.editorconfig +++ b/.editorconfig @@ -6,6 +6,9 @@ # "run cleanup": https://betterprogramming.pub/enforce-net-code-style-with-editorconfig-d2f0d79091ac # TODO: build real editorconfig file: https://github.com/dotnet/roslyn/blob/main/.editorconfig +# Make field +dotnet_diagnostic.IDE0044.severity = warning + # Enable naming rule violation errors on build (alternative: dotnet_analyzer_diagnostic.category-Style.severity = error) dotnet_diagnostic.IDE1006.severity = error diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index a8413e61..94323bfa 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -60,8 +60,8 @@ jobs: run: | (cd src/Nexus.UI && libman restore) dotnet publish -c Release -o app /p:GeneratePackage=true src/Nexus/Nexus.csproj - python -m build --wheel --outdir artifacts/packages --no-isolation src/clients/python-client - python -m build --wheel --outdir artifacts/packages --no-isolation src/extensibility/python-extensibility + python -m build --wheel --outdir artifacts/package --no-isolation src/clients/python-client + python -m build --wheel --outdir artifacts/package --no-isolation src/extensibility/python-extensibility - name: Test run: | @@ -90,7 +90,7 @@ jobs: name: artifacts path: | artifacts/*.txt - artifacts/packages/ + artifacts/package/ artifacts/images/ - name: Prepare GitHub Pages @@ -129,12 +129,12 @@ jobs: run: docker load --input artifacts/images/nexus_image.tar - name: Nuget package (MyGet) - run: dotnet nuget push 'artifacts/packages/*.nupkg' --api-key ${MYGET_API_KEY} --source https://www.myget.org/F/apollo3zehn-dev/api/v3/index.json + run: dotnet nuget push 'artifacts/package/*.nupkg' --api-key ${MYGET_API_KEY} --source https://www.myget.org/F/apollo3zehn-dev/api/v3/index.json env: MYGET_API_KEY: ${{ secrets.MYGET_API_KEY }} - name: Python package (MyGet) - run: 'for filePath in artifacts/packages/*.whl; do curl -k -X POST https://www.myget.org/F/apollo3zehn-dev/python/upload -H "Authorization: Bearer ${MYGET_API_KEY}" -F "data=@$filePath"; done' + run: 'for filePath in artifacts/package/*.whl; do curl -k -X POST https://www.myget.org/F/apollo3zehn-dev/python/upload -H "Authorization: Bearer ${MYGET_API_KEY}" -F "data=@$filePath"; done' env: MYGET_API_KEY: ${{ secrets.MYGET_API_KEY }} @@ -179,12 +179,12 @@ jobs: body_path: artifacts/tag_body.txt - name: Nuget package (Nuget) - run: dotnet nuget push 'artifacts/packages/*.nupkg' --api-key ${NUGET_API_KEY} --source https://api.nuget.org/v3/index.json + run: dotnet nuget push 'artifacts/package/*.nupkg' --api-key ${NUGET_API_KEY} --source https://api.nuget.org/v3/index.json env: NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} - name: Python Package (PyPI) - run: twine upload artifacts/packages/*.whl -u__token__ -p"${PYPI_API_KEY}" + run: twine upload artifacts/package/*.whl -u__token__ -p"${PYPI_API_KEY}" env: PYPI_API_KEY: ${{ secrets.PYPI_API_KEY }} diff --git a/src/Nexus/Services/DataService.cs b/src/Nexus/Services/DataService.cs index 0a1391b9..e51d60b2 100644 --- a/src/Nexus/Services/DataService.cs +++ b/src/Nexus/Services/DataService.cs @@ -1,5 +1,4 @@ -using System.Buffers; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.IO.Compression; using System.IO.Pipelines; using System.Security.Claims; @@ -346,7 +345,7 @@ private async Task CreateFilesAsync( } catch { - cts.Cancel(); + await cts.CancelAsync(); throw; } }