Skip to content

Migrate ActiveItem tests from Stowzilla#2

Merged
ardavis merged 2 commits into
masterfrom
fizzy-842-migrate-activeitem-tests
May 22, 2026
Merged

Migrate ActiveItem tests from Stowzilla#2
ardavis merged 2 commits into
masterfrom
fizzy-842-migrate-activeitem-tests

Conversation

@ardavis
Copy link
Copy Markdown
Contributor

@ardavis ardavis commented May 21, 2026

Migrates test coverage from the Stowzilla app's spec/models/dynamo_record/ into the ActiveItem gem.

New specs (12 files, 111 total examples)

  • batch_find_spec — chunking, persisted records, missing IDs
  • batch_find_unprocessed_keys_spec — retry with exponential backoff
  • batch_write_spec — chunking at 25, timestamps, bypasses callbacks
  • callback_on_option_specbefore_save on: :create/:update
  • composed_of_spec — value object read/write/persistence
  • explain_specRelation#explain introspection
  • includes_spec — preloading belongs_to + has_many :count
  • parallel_preload_spec — threaded count preloading
  • relation_load_specRelation#load full hydration
  • relation_order_specRelation#order with scan_index_forward
  • select_specRelation#select projection expression
  • uniqueness_validator_spec — uniqueness with scope

Also fixes FakeDynamoClient#query to return count field for SELECT COUNT queries.

Fizzy #842

ardavis added 2 commits May 21, 2026 18:29
Migrates the following test coverage from the Stowzilla app into the
ActiveItem gem:

- batch_find_spec: batch_find with chunking and persisted records
- batch_find_unprocessed_keys_spec: retry logic with exponential backoff
- batch_write_spec: batch_write with chunking, timestamps, no callbacks
- callback_on_option_spec: before_save/after_save with on: :create/:update
- composed_of_spec: value object reader/writer/persistence
- explain_spec: Relation#explain for query/scan introspection
- includes_spec: preloading belongs_to and has_many :count
- parallel_preload_spec: threaded count preloading
- relation_load_spec: Relation#load for full hydration
- relation_order_spec: Relation#order with scan_index_forward
- select_spec: Relation#select projection expression
- uniqueness_validator_spec: uniqueness validation with scope

Also fixes FakeDynamoClient#query to return count field for SELECT COUNT
queries used by the preloading system.

Closes #842
- Add docker-compose.yml for amazon/dynamodb-local
- Add spec/support/dynamodb_local_helper.rb for table lifecycle
- Rewrite all specs to use real Aws::DynamoDB::Client against localhost:8000
- Tests now verify actual put/get/query/scan against a real DynamoDB engine
- 110 examples, 0 failures
@ardavis ardavis merged commit f20cd7e into master May 22, 2026
2 checks passed
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