Skip to content

test(providers): reorganize DPS test suite and add cross-provider XSD coverage (#88 #89 #90)#91

Merged
john182 merged 1 commit into
masterfrom
feature/dps-test-reorganization-and-coverage
Mar 28, 2026
Merged

test(providers): reorganize DPS test suite and add cross-provider XSD coverage (#88 #89 #90)#91
john182 merged 1 commit into
masterfrom
feature/dps-test-reorganization-and-coverage

Conversation

@john182

@john182 john182 commented Mar 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Reorganiza toda a estrutura de testes separando Engine de Providers em pastas dedicadas
  • Adiciona cobertura de FillingVariations (21 cenários DPS) para todos os 7 providers principais e 48 providers de data/
  • Remove catch(ShouldAssertException) silencioso que escondia falhas de validação XSD em ExternalProviderXmlGenerationTests
  • Expõe 18 providers com gaps reais da engine — documentados e com issues abertas

Estrutura final

UnitTests/
├── Engine/
│   ├── SchemaAnalyzer/    (4 files)
│   ├── Serializer/        (5 files)
│   ├── Rules/             (7 files)
│   ├── ProviderConfig/    (12 files)
│   └── Diagnostics/       (4 files)
├── Providers/
│   ├── _Shared/           (5 helpers)
│   ├── Nacional/          (7 test files)
│   ├── Issnet/            (1 test file)
│   ├── Gissonline/        (2 test files)
│   ├── Abrasf/            (4 test files)
│   ├── Webiss, Simpliss, Paulistana
│   └── AllDataProvidersFillingVariationsTests.cs (48 providers × 21 cenários)
IntegrationsTests/
├── Engine/
└── Providers/

Cobertura

Métrica Valor
Providers testados 48
Cenários DPS por provider 21 (Minimal, IBS/CBS, Intermediário, Exportação, Obra, Deduções, etc.)
Total combinações 1008
Providers 100% PASS 30
Providers com gaps (issues abertas) 18

Issues abertas (priority: critical)

Documentação atualizada

  • providers/runtime-xsd-validation-summary.md — status completo dos 48 providers
  • openspec/specs/nfse-product-roadmap/spec.md — backlog de XSD compliance como blocker para Production Ready

Test plan

🤖 Generated with Claude Code

… coverage

Reorganize the entire test structure separating Engine tests from Provider tests,
add FillingVariations coverage for all 7 main providers and 48 data providers,
remove silent catch that hid XSD validation failures, and document 18 engine gaps.

Structure changes:
- SchemaEngine/ → Engine/{SchemaAnalyzer,Serializer,Rules,ProviderConfig,Diagnostics}/
- Manual/ → Providers/Nacional/ + Providers/_Shared/
- Provider tests from SchemaEngine/ → Providers/{Issnet,Gissonline,Abrasf,Webiss,Simpliss,Paulistana}/
- Integration tests separated into Engine/ and Providers/

Coverage additions:
- FillingVariations (25 scenarios) for all 7 main providers with schema validation
- AllDataProvidersFillingVariationsTests: 48 providers × 21 DPS filling patterns = 1008 combinations
- 30 providers pass 100%, 18 have engine gaps (issues #88, #89, #90)

Fixes:
- Remove silent catch(ShouldAssertException) in ExternalProviderXmlGenerationTests
- Remove silent return on null context — now asserts explicitly

Documentation:
- Updated runtime-xsd-validation-summary.md with full 48-provider status
- Updated nfse-product-roadmap spec with XSD compliance backlog
- Created GitHub issues #88 #89 #90 for the 3 categories of engine gaps

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 27, 2026 23:56
@sonarqubecloud

Copy link
Copy Markdown

@john182
john182 merged commit 93bac42 into master Mar 28, 2026
3 of 5 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reorganizes the DPS test suite to clearly separate engine vs provider tests, and adds broad cross-provider XSD validation coverage (including documentation) to expose real engine gaps across providers.

Changes:

  • Reorganized unit/integration test folders and namespaces into Engine/* and Providers/*, with shared provider helpers under Providers/_Shared.
  • Added/expanded provider tests to validate multiple DpsDocument filling variations against each provider’s XSD (plus a cross-provider “all data providers” suite).
  • Updated documentation/specs and added issue writeups for discovered engine XSD compliance gaps.

Reviewed changes

Copilot reviewed 74 out of 152 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/SemanaIA.ServiceInvoice.UnitTests/Providers/AllDataProvidersFillingVariationsTests.cs New cross-provider XSD validation suite (48 providers × multiple scenarios) and report generator.
tests/SemanaIA.ServiceInvoice.UnitTests/Engine/ProviderConfig/ExternalProviderXmlGenerationTests.cs Removed silent swallowing of XSD failures; now asserts schema prep/XML generation/XSD validity.
tests/SemanaIA.ServiceInvoice.UnitTests/Providers/_Shared/XsdValidationHelper.cs Moved shared XSD validation helpers to provider-shared namespace.
tests/SemanaIA.ServiceInvoice.UnitTests/Providers/_Shared/DpsDocumentBuilder.cs Moved shared DPS document builder into provider-shared helpers.
tests/SemanaIA.ServiceInvoice.UnitTests/Providers/_Shared/DpsDocumentTestFixture.cs Moved shared fixture (incl. filling variations) into provider-shared helpers.
tests/SemanaIA.ServiceInvoice.UnitTests/Providers/_Shared/TestProviderPaths.cs Centralized provider test path resolution under provider-shared helpers.
tests/SemanaIA.ServiceInvoice.UnitTests/Providers/_Shared/XmlParseHelpers.cs Consolidated Nacional XML parsing helpers into shared helper.
tests/SemanaIA.ServiceInvoice.UnitTests/Providers/Abrasf/AbrasfBaseXmlSerializationTests.cs Added FillingVariations theory with provider XSD validation; updated namespace/imports.
tests/SemanaIA.ServiceInvoice.UnitTests/Providers/Abrasf/AbrasfEnvelopeSerializationTests.cs Provider test namespace/import reorg.
tests/SemanaIA.ServiceInvoice.UnitTests/Providers/Abrasf/AbrasfSchemaGenerationTests.cs Provider test namespace/import reorg.
tests/SemanaIA.ServiceInvoice.UnitTests/Providers/Abrasf/AbrasfXsdValidationTests.cs Provider test namespace/import reorg.
tests/SemanaIA.ServiceInvoice.UnitTests/Providers/Gissonline/GissonlineXmlSerializationTests.cs Added FillingVariations theory with XSD validation; updated namespace/imports.
tests/SemanaIA.ServiceInvoice.UnitTests/Providers/Gissonline/GissonlineSchemaGenerationTests.cs Provider test namespace/import reorg.
tests/SemanaIA.ServiceInvoice.UnitTests/Providers/Issnet/IssnetXmlSerializationTests.cs Added FillingVariations theory with XSD validation; updated namespace/imports.
tests/SemanaIA.ServiceInvoice.UnitTests/Providers/Webiss/WebissXmlSerializationTests.cs Added FillingVariations theory with XSD validation; updated namespace/imports.
tests/SemanaIA.ServiceInvoice.UnitTests/Providers/Simpliss/SimplissXmlSerializationTests.cs Added FillingVariations theory with XSD validation; updated namespace/imports.
tests/SemanaIA.ServiceInvoice.UnitTests/Providers/Paulistana/PaulistanaXmlSerializationTests.cs Added FillingVariations theory with XSD validation; updated namespace/imports.
tests/SemanaIA.ServiceInvoice.UnitTests/Providers/Nacional/NacionalDpsSerializationTests.cs Renamed/moved Nacional tests; added FillingVariations schema-validation theory.
tests/SemanaIA.ServiceInvoice.UnitTests/Providers/Nacional/NacionalXmlSerializerTaxationTypeTests.cs Namespace/import updates to use shared helpers.
tests/SemanaIA.ServiceInvoice.UnitTests/Providers/Nacional/NacionalXmlSerializerRetentionTypeTests.cs Namespace/import updates to use shared helpers.
tests/SemanaIA.ServiceInvoice.UnitTests/Providers/Nacional/NacionalXmlSerializerOptionalBlocksTests.cs Namespace/import updates to use shared helpers.
tests/SemanaIA.ServiceInvoice.UnitTests/Providers/Nacional/NacionalXmlSerializerDeductionTests.cs Namespace/import updates to use shared helpers.
tests/SemanaIA.ServiceInvoice.UnitTests/Providers/Nacional/IbsCbsManualBuilderTests.cs Namespace/import updates under Providers/Nacional.
tests/SemanaIA.ServiceInvoice.UnitTests/Providers/Nacional/GenerateNacionalArtifactsTests.cs Namespace/import updates under Providers/Nacional.
tests/SemanaIA.ServiceInvoice.UnitTests/Providers/Nacional/generated/* Added generated artifacts (docs/skeleton/records); compilation excluded via csproj.
tests/SemanaIA.ServiceInvoice.UnitTests/Snapshots/GoldenMasterTests.cs Updated using to new shared helper namespace.
tests/SemanaIA.ServiceInvoice.UnitTests/Snapshots/ManualVsEngineComparisonTests.cs Updated using to new shared helper namespace.
tests/SemanaIA.ServiceInvoice.UnitTests/Engine/* Namespace moves from legacy SchemaEngine to Engine.<area> and shared helper import updates.
tests/SemanaIA.ServiceInvoice.IntegrationsTests/Engine/ManualVsEngineApiComparisonTests.cs Integration test namespace reorg under IntegrationsTests.Engine.
tests/SemanaIA.ServiceInvoice.IntegrationsTests/Providers/ProviderEndToEndFlowTests.cs Integration test namespace reorg under IntegrationsTests.Providers.
tests/SemanaIA.ServiceInvoice.UnitTests/SemanaIA.ServiceInvoice.UnitTests.csproj Excludes **/generated/** from compilation to avoid compiling generated artifacts.
providers/runtime-xsd-validation-summary.md Updated provider-wide XSD compliance summary (30 pass / 18 gaps) derived from new tests.
tests/SemanaIA.ServiceInvoice.UnitTests/Providers/runtime-xsd-validation-summary.md Added a test-local runtime validation summary.
openspec/specs/nfse-product-roadmap/spec.md Added “Engine XSD compliance backlog” requirement for Production Ready.
openspec/changes/dps-test-reorganization-and-coverage/* Added spec-driven change docs (proposal/design/tasks/specs + yaml).
.github/issues/issue-*.md Added issue documents describing exposed gaps and the removed silent-catch problem.

Comment on lines +59 to +62
[Theory]
[MemberData(nameof(AllProviders))]
public void Given_DpsMinimo_Should_GerarXmlValidoParaProvider(string providerName)
=> AssertProviderGeneratesValidXml(providerName, new DpsDocumentBuilder().Build());

Copilot AI Mar 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new cross-provider [Theory] tests assert that every provider under tests/.../data produces XSD-valid XML for each scenario. The PR description/docs indicate 18 providers currently fail XSD validation, and CI runs dotnet test tests/SemanaIA.ServiceInvoice.UnitTests without filters, so this will make the build fail on main. Consider converting these into a report-only test (like the existing report Fact) or explicitly quarantining/skipping known-gap providers with documented reasons, so CI stays green while still tracking progress.

Copilot uses AI. Check for mistakes.
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.

2 participants