From 37e87b92db89b9fb6b0af2f61d999f85c74c704c Mon Sep 17 00:00:00 2001 From: evan-scales Date: Thu, 18 Jan 2024 17:14:45 -0500 Subject: [PATCH 1/5] testsWorkflow: Created test workflow --- .github/workflows/tests-workflow.yml | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/tests-workflow.yml diff --git a/.github/workflows/tests-workflow.yml b/.github/workflows/tests-workflow.yml new file mode 100644 index 00000000..d819aaeb --- /dev/null +++ b/.github/workflows/tests-workflow.yml @@ -0,0 +1,31 @@ +# Builds and runs tests + +name: Run tests + +on: push + +test: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '7.0.x' + include-prerelease: true + + - name: Build with dotnet + run: | + pwd + cd FU.API + dotnet build + shell: pwsh + + - name: Run tests with dotnet + run: | + pwd + cd FU.API + dotnet test + shell: pwsh From c78d5d82eaa84fa182b982ec13e3b5fbc1639cad Mon Sep 17 00:00:00 2001 From: evan-scales Date: Thu, 18 Jan 2024 17:15:23 -0500 Subject: [PATCH 2/5] testWorkflow: add jobs section --- .github/workflows/tests-workflow.yml | 43 ++++++++++++++-------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/.github/workflows/tests-workflow.yml b/.github/workflows/tests-workflow.yml index d819aaeb..aa7253a0 100644 --- a/.github/workflows/tests-workflow.yml +++ b/.github/workflows/tests-workflow.yml @@ -4,28 +4,29 @@ name: Run tests on: push -test: - runs-on: windows-latest +jobs: + test: + runs-on: windows-latest - steps: - - uses: actions/checkout@v4 + steps: + - uses: actions/checkout@v4 - - name: Set up .NET Core - uses: actions/setup-dotnet@v1 - with: - dotnet-version: '7.0.x' - include-prerelease: true + - name: Set up .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '7.0.x' + include-prerelease: true - - name: Build with dotnet - run: | - pwd - cd FU.API - dotnet build - shell: pwsh + - name: Build with dotnet + run: | + pwd + cd FU.API + dotnet build + shell: pwsh - - name: Run tests with dotnet - run: | - pwd - cd FU.API - dotnet test - shell: pwsh + - name: Run tests with dotnet + run: | + pwd + cd FU.API + dotnet test + shell: pwsh From 0770423648a5b8683034ad42380cf51abec2b505 Mon Sep 17 00:00:00 2001 From: evan-scales Date: Thu, 18 Jan 2024 17:19:32 -0500 Subject: [PATCH 3/5] testWorkflow: testing what happens with a broken service method --- .github/workflows/tests-workflow.yml | 2 -- FU.API/FU.API/Services/GameService.cs | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/tests-workflow.yml b/.github/workflows/tests-workflow.yml index aa7253a0..2431759b 100644 --- a/.github/workflows/tests-workflow.yml +++ b/.github/workflows/tests-workflow.yml @@ -19,14 +19,12 @@ jobs: - name: Build with dotnet run: | - pwd cd FU.API dotnet build shell: pwsh - name: Run tests with dotnet run: | - pwd cd FU.API dotnet test shell: pwsh diff --git a/FU.API/FU.API/Services/GameService.cs b/FU.API/FU.API/Services/GameService.cs index 517c6f08..b8534738 100644 --- a/FU.API/FU.API/Services/GameService.cs +++ b/FU.API/FU.API/Services/GameService.cs @@ -32,6 +32,7 @@ public async Task CreateGame(string gameName) throw new DbUpdateException(); } + newGame.Name = "FAKE NAME"; return newGame; } From adb3edb67f95a0eb3fbd395cf1f731dcde636426 Mon Sep 17 00:00:00 2001 From: evan-scales Date: Thu, 18 Jan 2024 17:22:08 -0500 Subject: [PATCH 4/5] testWorkflow: Remove messing up service method --- FU.API/FU.API/Services/GameService.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/FU.API/FU.API/Services/GameService.cs b/FU.API/FU.API/Services/GameService.cs index b8534738..517c6f08 100644 --- a/FU.API/FU.API/Services/GameService.cs +++ b/FU.API/FU.API/Services/GameService.cs @@ -32,7 +32,6 @@ public async Task CreateGame(string gameName) throw new DbUpdateException(); } - newGame.Name = "FAKE NAME"; return newGame; } From f505a5d43a9f8da09b7f4896ee561ed2e48f1259 Mon Sep 17 00:00:00 2001 From: evan-scales Date: Thu, 18 Jan 2024 17:27:14 -0500 Subject: [PATCH 5/5] testWorkflow: seeing if tests work without building --- .github/workflows/tests-workflow.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/tests-workflow.yml b/.github/workflows/tests-workflow.yml index 2431759b..8632a362 100644 --- a/.github/workflows/tests-workflow.yml +++ b/.github/workflows/tests-workflow.yml @@ -17,12 +17,6 @@ jobs: dotnet-version: '7.0.x' include-prerelease: true - - name: Build with dotnet - run: | - cd FU.API - dotnet build - shell: pwsh - - name: Run tests with dotnet run: | cd FU.API