Skip to content
Open
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
60 changes: 5 additions & 55 deletions .github/workflows/healthchecks_solr_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,58 +29,8 @@ on:

jobs:
build:
runs-on: ubuntu-latest
# container: mcr.microsoft.com/dotnet/sdk:6.0
# services:
# solr:
# image: solr:8.4.1
# ports:
# - 8983:8983
# volumes:
# - ${{ github.workspace }}/build/docker-services/solrcore:/var/solr/data/solrcore
# - ${{ github.workspace }}/build/docker-services/solrcoredown:/var/solr/data/solrcoredown
steps:
# - name: Provide permission for deleting volume files
# run: sudo chown -R $USER:$USER /home/runner/work/${{ github.event.repository.name }}

- uses: actions/checkout@v3
- name: Initialize Solr
run: |
docker run -d -p8983:8983 -v${{ github.workspace }}/build/docker-services/solrcore:/var/solr/data/solrcore -v${{ github.workspace }}/build/docker-services/solrcoredown:/var/solr/data/solrcoredown solr:8.4.1
- name: Test Solr
run: |
wget http://localhost:8983/solr/#
curl http://localhost:8983/solr/# -v
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x
- name: Restore
run: |
dotnet restore ./src/HealthChecks.Solr/HealthChecks.Solr.csproj &&
dotnet restore ./test/HealthChecks.Solr.Tests/HealthChecks.Solr.Tests.csproj
- name: Check formatting
run: |
dotnet format --no-restore --verify-no-changes --severity warn ./src/HealthChecks.Solr/HealthChecks.Solr.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1) &&
dotnet format --no-restore --verify-no-changes --severity warn ./test/HealthChecks.Solr.Tests/HealthChecks.Solr.Tests.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1)
- name: Build
run: |
dotnet build --no-restore ./src/HealthChecks.Solr/HealthChecks.Solr.csproj &&
dotnet build --no-restore ./test/HealthChecks.Solr.Tests/HealthChecks.Solr.Tests.csproj
#- name: Test
# run: >
# dotnet test
# ./test/HealthChecks.Solr.Tests/HealthChecks.Solr.Tests.csproj
# --no-restore
# --no-build
# --collect "XPlat Code Coverage"
# --results-directory .coverage
# --
# DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
#- name: Upload Coverage
# uses: codecov/codecov-action@v3
# with:
# flags: Solr
# directory: .coverage
uses: ./.github/workflows/reusable_ci_workflow.yml
with:
PROJECT_PATH: ./src/HealthChecks.Solr/HealthChecks.Solr.csproj
TEST_PROJECT_PATH: ./test/HealthChecks.Solr.Tests/HealthChecks.Solr.Tests.csproj
CODECOV_FLAGS: Solr
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace HealthChecks.Solr.Tests.Functional;

public class solr_healthcheck_should
public class solr_healthcheck_should(SolrContainerFixture solrFixture) : IClassFixture<SolrContainerFixture>
{
[Fact]
public async Task be_healthy_if_solr_is_available()
Expand All @@ -12,7 +12,7 @@ public async Task be_healthy_if_solr_is_available()
.ConfigureServices(services =>
{
services.AddHealthChecks()
.AddSolr("http://localhost:8983/solr", "solrcore", tags: ["solr"]);
.AddSolr(solrFixture.GetConnectionString(), "solrcore", tags: ["solr"]);
})
.Configure(app =>
{
Expand All @@ -35,7 +35,7 @@ public async Task be_unhealthy_if_solr_ping_is_disabled()
.ConfigureServices(services =>
{
services.AddHealthChecks()
.AddSolr("http://localhost:8893/solr", "solrcoredown", tags: ["solr"]);
.AddSolr(solrFixture.GetConnectionString(), "solrcoredown", tags: ["solr"]);
})
.Configure(app =>
{
Expand Down
10 changes: 10 additions & 0 deletions test/HealthChecks.Solr.Tests/HealthChecks.Solr.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,14 @@
<ProjectReference Include="..\..\src\HealthChecks.Solr\HealthChecks.Solr.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Testcontainers" />
</ItemGroup>

<ItemGroup>
<None Update="Resources/**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>

Large diffs are not rendered by default.

Loading