Skip to content

test: critical-journey tests (verify v2) - #37

Open
AhmadRAbuhussein wants to merge 1 commit into
mainfrom
test/critical-journeys
Open

AhmadRAbuhussein wants to merge 1 commit into
mainfrom
test/critical-journeys

Conversation

@AhmadRAbuhussein

Copy link
Copy Markdown
Contributor

Branch test/critical-journeys → main (the GitHub default branch; there is no develop or staging branch).

Journeys (SW.Logger.IntegrationTests, Testcontainers)

SimplyWorks.Logger.ElasticSearch talks to an outside system, so the new project exercises it against a real throwaway Elasticsearch: elasticsearch:8.18.2, matching the Elastic.Serilog.Sinks 8.18 client, single node, security off.

Journey What it proves
Logs_ReachTheDataStream_AtTheConfiguredLevel A host using UseSwElasticSearchLogger ships its logs to logs-{app}-{env}. The stored entry has the rendered message, the level and the Environment label. A Debug entry below the configured level isn't shipped.
RetentionPolicy_IsSavedAndAppliedToTheDataStream {stream}-retention is saved with the configured delete.min_age and post-rollover replicas, and is applied to the data stream (index.lifecycle.name).

The project is in SW.Logger.sln and references Testcontainers, so verify runs it in its Docker-enabled integration job. It is IsPackable=false, so nuget-publish doesn't pack it.

Agent instructions

New AGENTS.md with the "Critical-journey tests (verify)" section. The README has a new Tests section and the project in Project Structure.

Run locally

dotnet test SW.Logger.IntegrationTests   # needs Docker

Results: 2/2 pass, and the existing SW.Logger.UnitTests still pass 25/25. On Docker Desktop for macOS you may need TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock.

Not covered or worth a look

  • Version assumed: the Elasticsearch version is pinned to 8.18.2 on the assumption that consumers run 8.x. Pin it to the production cluster's exact version if it differs.
  • Plain HTTP only: the container runs without TLS or auth so the test can read Elasticsearch back. HTTPS and certificate paths aren't covered.
  • Retention with a private CA: RetentionManager builds its NEST client without the sink's certificate handling. It ignores ElasticsearchCertificatePath and has no validation callback, so on a cluster with a private CA the retention policy probably fails to apply ("applying log retention ... failed") while logging still works. Worth checking separately; it isn't changed here.
  • No verify.yml yet: the repo isn't enrolled, so gh workflow run verify.yml was skipped.

@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML; Path: .coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 45d9c057-f887-4c4a-953f-01df46d8447e
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant