Skip to content
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

More testing #187

Merged
merged 1 commit into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build pull request or PR

on:
pull_request:
push:
branches:
- main

jobs:

build:
runs-on: ubuntu-latest
env:
DOTNET_NOLOGO: true

steps:
- uses: actions/checkout@v3
with:
submodules: true

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
8.0.x

- name: Build and test
run: |
dotnet build build/Tools.sln
dotnet build -c Release src/NodaTime-Web.sln
dotnet test -c Release src/NodaTime.Web.Test
4 changes: 2 additions & 2 deletions build/buildweb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ dotnet publish -v quiet -c Release $ROOT/src/NodaTime.Web
# (Blazor is currently disabled.)
# sed -i 's/\\/\//g' $WEB_DIR/NodaTime.Web.Blazor.blazor.config

# Run a smoke test to check it still works
# dotnet test ../src/NodaTime.Web.SmokeTest
# Run a smoke test to check it still works, but without using GCS
STORAGE__BUCKET=local:fakestorage dotnet test ../src/NodaTime.Web.SmokeTest

# Add diagnostic text files
# commit.txt only contains commit info
Expand Down
4 changes: 2 additions & 2 deletions src/NodaTime.Web.SmokeTest/FetchPagesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public FetchPagesTest()
[TestCase("1.0.x/userguide/text", "There are two options for text handling")]
[TestCase("1.0.x/api/NodaTime.DateTimeZone.html", "The mapping is unambiguous")]
// Note: not the full URL as that depends on the server URL
[TestCase("tzdb/index.txt", "/tzdb/tzdb2013h.nzd")]
[TestCase("tzdb/index.txt", "/tzdb/tzdb2018h.nzd")]
public async Task TextPage(string path, string expectedContent)
{
var client = new HttpClient();
Expand All @@ -32,7 +32,7 @@ public async Task TextPage(string path, string expectedContent)
}

[Test]
[TestCase("tzdb/tzdb2013h.nzd", 125962)]
[TestCase("tzdb/tzdb2018h.nzd", 135698)]
public async Task Binary(string path, int expectedSize)
{
var client = new HttpClient();
Expand Down
3 changes: 2 additions & 1 deletion src/NodaTime.Web/appsettings.SmokeTests.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
},

"Storage": {
"BenchmarkLimit": 10
"BenchmarkLimit": 10,
//"Bucket": "local:fakestorage"
}
}
Loading