Tests using available entities 8e2#334
Merged
Merged
Conversation
Test: Generate mockup context using the in-source generator against the Tooling environment Test: Add polyfills for the NET8+ validation attributes used in the context
…isables all Calc evaluation. Fix: Actually return the calculated result (did this ever work?)
…ed down Engine: calc fields evaluated on-demand (not persisted), PowerFx numeric coercion + per-field eval resilience, reserved True/False workflow-variable guard. Provisioner: ordered enforced-state-transition setup. Tests migrated to ctx_parent/ctx_child + XrmMockup Test roles; removed-entity tests skipped with reason; workflow fixtures relocated to regen-safe OtherWorkflows. 569 passing / 7 failing / 34 skipped (net8.0); both target frameworks build. Co-Authored-By: Claude <noreply@anthropic.com> via Conducktor <conducktor@contextand.com>
These follow the same path as if they came from the environment
Fix: Allow us to inject an action by metadata and call that
…l skips Restore TestIncident/TestQuote/TestOpportunity (CloseIncident/Win/Lose/Revise request-handler tests) in original early-bound form behind #if INCLUDE_REMOVED_ENTITY_TESTS, so the logic is visible/version-controlled and build stays green; re-enable by provisioning the entities + regenerating the context + defining the symbol. Remove tests that no longer carry meaningful, in-scope coverage: - TestActionExecution (ActionTest set 16 Lead-specific fields; action I/O is covered by TestActionParts) - TestFormulaFieldEvaluated (redundant with TestCalculatedIsSetRetrieveMultiple) - ContextJoinTest/ContextLoadDifferentEntitiesTest (Load/LoadEnumeration is XrmContext-generated code; testing it belongs in XrmContext's suite) net8.0: 577 passing / 0 failing / 1 skipped; both target frameworks build. Co-Authored-By: Claude <noreply@anthropic.com> via Conducktor <conducktor@contextand.com>
…metadata (copied from the old generated context)
…metadata fileattachment is now one of the metadata generator's default entities, so Core no longer fabricates its EntityMetadata at runtime. Dropped Core.EnsureFileAttachmentMetadata (+ the SetMetadataProperty / CreateAttributeMetadata reflection helpers) and the now-unused XrmDb.RegisterEntityMetadata. InitializeFileBlocksUpload now throws a descriptive MockupException when the fileattachment entity is absent from the loaded metadata, directing the user to regenerate metadata that includes it (rather than silently using a synthetic definition). Full suite: 605 passing / 0 failing / 1 skipped; both target frameworks build. Co-Authored-By: Claude <noreply@anthropic.com> via Conducktor <conducktor@contextand.com>
Master's merge added TestQueryExpression{NotEqual,NotIn,DoesNotBeginWith,
LinkEntityNotEqual}ExcludesNull written against the Lead early-bound type, which
doesn't exist on this branch (build failure). Migrated them to ctx_parent:
ctx_postalcode for the value (only p1 has one; the rest are null) and
ctx_contactid for the contact->ctx_parent link — same null-exclusion semantics.
Full suite: 609 passing / 0 failing / 1 skipped.
Co-Authored-By: Claude <noreply@anthropic.com> via Conducktor <conducktor@contextand.com>
…e key PluginManager caches registered plugins in a process-static dictionary keyed by GeneratePluginCacheKey, which only hashed basePluginTypes. Two XrmMockupSettings with the same base types but different IPluginMetadata (e.g. XrmMockupFixture vs TestLogging) collided on one key, so whichever Core initialized first populated the shared cache and the other reused it — leaking/omitting plugin registrations by test order. This passed locally but failed ~10 plugin tests in CI. Include the plugin metadata (type, message, entity, stage, rank, mode, filtered attributes, images) in the cache key so different plugin sets never share an entry. Adds TestPluginCacheIsolation as a deterministic regression guard. Full suite: 610 passing / 0 failing / 1 skipped; both target frameworks build. Co-Authored-By: Claude <noreply@anthropic.com> via Conducktor <conducktor@contextand.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrate test suite to the fresh Dataverse environment
Why
The Dataverse test environment was re-creasted — several entities (
Lead,Opportunity/OpportunityClose,Incident/IncidentResolution,Quote/QuoteClose/QuoteDetail,dg_bus,dg_child) and security roles are not part of the new environment. The test suite, metadata, and generated context were all built against the old environment, so we had to manually maintain the context. This PR migrates everything to the available schema and gets the suite fully green, with no loss of meaningful coverage.Result
net462,net8.0) build.TestServiceRoles.TestCreateDefaultValues) is a pre-existing "disagreement over test" skip that predates this work.What changed
Test migration to available entities
ctx_parent/ctx_child+ a minimal set ofXrmMockup Test *security roles.tests/TestEnvProvisioner— a console tool that idempotently provisions the custom entities, fields (incl. calculated/rollup/PowerFx), relationships, alternate keys, and roles into the environment, so a new dev can stand up a working environment without manual portal setup.Engine fixes (
src/XrmMockup365)Truevariable defaulting toFalse, which clobbered the engine's boolean constant and silenced everyConditionBranch— now guarded.Retrieve).WorkflowManager.AddWorkflownow registers category-3 custom actions (previously mis-filed as workflows, so a runtime-added action was never invocable).Removed-entity request handlers preserved
CloseIncident,Win/Close/Revisequote,Win/Loseopportunity) are still exercised: their entity metadata is hard-copied from the old generated metadata intoRemovedEntitiesMetadata.xml(auto-merged via XrmMockup's multi-file metadata loading), and the tests were rewritten late-bound so they don't depend on the removed early-bound types. Two deleted plugins were re-created late-bound and registered via the fixture.Workflows & plugins
Metadata/OtherWorkflows/(the generator wipesMetadata/Workflows/on every regen);WaitingWorkflowretargeted offdg_bustoctx_parent.IPluginMetadatain the fixture.Notes for reviewers
RemovedEntitiesMetadata.xmlis intentionally hard-copied from the old environment's metadata (those entities can't be provisioned). It survives regen because the generator only rewritesMetadata.xml+ theWorkflows/SecurityRolesdirs.EnforceStateTransitionsonctx_parentwas enabled in the maker portal — the provisioner's SDK approach for that one entity-level flag doesn't reliably persist (noted inTestEnvProvisioner).🤖 Generated with Claude Code