test(providers): reorganize DPS test suite and add cross-provider XSD coverage (#88 #89 #90)#91
Conversation
… 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>
|
There was a problem hiding this comment.
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/*andProviders/*, with shared provider helpers underProviders/_Shared. - Added/expanded provider tests to validate multiple
DpsDocumentfilling 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. |
| [Theory] | ||
| [MemberData(nameof(AllProviders))] | ||
| public void Given_DpsMinimo_Should_GerarXmlValidoParaProvider(string providerName) | ||
| => AssertProviderGeneratesValidXml(providerName, new DpsDocumentBuilder().Build()); |
There was a problem hiding this comment.
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.



Summary
data/catch(ShouldAssertException)silencioso que escondia falhas de validação XSD emExternalProviderXmlGenerationTestsEstrutura final
Cobertura
Issues abertas (priority: critical)
Documentação atualizada
providers/runtime-xsd-validation-summary.md— status completo dos 48 providersopenspec/specs/nfse-product-roadmap/spec.md— backlog de XSD compliance como blocker para Production ReadyTest plan
dotnet build— 0 errors, 0 warningsSchemaEngine,Manual) permaneceGiven_<contexto>_Should_<comportamento>🤖 Generated with Claude Code