Repository navigation
Conversation
…c record scenarios
Owner
Author
|
Superseded by #7, which carries this PR's commits unchanged together with the rest of the stack as one PR. |
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.
While adding aggregate support to AshSQLite, I didn't know how much of Ash's behaviour a data layer is actually meant to support, or how far SQLite was from AshPostgres. I built an aggregate conformance suite in AshSQL (wtsnz/ash_sql#9) to map that out. This PR turns it into a data-layer conformance suite hosted in Ash.
It is two things:
Postgres is a comparison implementation, not the definition of correct. Expected answers come from Ash's documentation and tests, or from decisions recorded in
GAPS.mdandSEMANTICS.md.Start with
FEATURES.mdconformance/FEATURES.mdlists 80 features in 10 levels. Each feature is backed by scenarios that run through Ash's public API, and every scenario belongs to exactly one feature. For each data layer the report shows one of:Each non-working feature links to the gap behind it, with an owner: Ash, AshSQL, AshSQLite or AshPostgres.
A "claims versus results" section compares each data layer's
can?/2claims with what happened, and flags three cases:That's 302 scenarios and 599 adapter checks. Four features are listed as untested so the specification stays complete:
Data layers without reviewed expectations
mix conformance.survey ADAPTERruns every scenario an integration can host and classifies each result against the intended answer: works, rejected, wrong, crashed or open question. The report is marked unreviewed.surveys/features-ets.mdis Ash's own ETS data layer surveyed this way: 252 of 297 work. It needs no Ecto, repository or SQL. Adapters in other repositories can join through config, and supply their own expectations and resource configuration without editing shared code.Comparing Ash main with the unreleased work
CONFORMANCE_DEPS=upstreamswaps all three adapters to ash-projectmain, with a separate lock file.mix conformance.compare_surveysthen diffs two surveys feature by feature.mainOn SQLite, 22 features change between the two. Postgres is identical, so the aggregate extraction changes nothing there. The comparison also surfaced a regression in ash_sqlite#232 on its own: sorted, paginated reads with a to-many filter return duplicates. A CI job posts this comparison to the job summary on every push, without blocking.
How results are kept honest
2and2.0are different results.Notable findings
return_skipped_upsert?is set.nil, althoughinclude_nil?defaults to false. This predates the extraction.throughrelationships load wrong data, because Ash only warns at compile time. Many-to-many load limits apply across all parents instead of per parent.true or nilisnil; every SQL data layer returns true.Layout
conformance/libis organised by responsibility:contracts/holds the feature catalog, expectations, gaps and claims;scenarios/has one file per feature level, withaggregates/by topic;resources/,fixtures/,adapters/(one file per adapter),sql/,report/andbenchmark/hold the rest.AUTHORING.mdcovers adding scenarios and adapters.Benchmarks
mix conformance.benchruns seven warm, single-client read workloads, including an unrelated-rows selectivity experiment. Each answer is checked before timing, and results include raw samples, query counts and run metadata. SeeBENCHMARKS.md.Dependencies
override: true)wtsnz/ash_sql0985b9f(override: true)wtsnz/ash_sqlite46a4b86ash-project/ash_postgres945073e4mix.upstream.lockpins theupstreamset.CONFORMANCE_ASH_*_PATHpoints at local checkouts for development; CI never sets it.Validation
On Elixir 1.20.0 / OTP 29, PostgreSQL 17.5 and SQLite 3.53.4:
--warnings-as-errorsand Dialyzer pass.auditjob fails on an advisory formint 1.10.0in Ash's rootmix.lock, which this PR doesn't change.