pocket icon indicating copy to clipboard operation
pocket copied to clipboard

[E2E] Assert on database state in E2E tests

Open dylanlott opened this issue 1 year ago • 2 comments

Objective

The current E2E tests are fire-and-forget broadcast or send messages. A component is needed to assert on the state of each validator's database.

Origin Document

E2E Testing Framework

Goals

  • Allow for querying each validator's PostgreSQL database to be queried and asserted in a step definition.
  • Investigate if a similar approach can be used for each validator's Badger database.

Deliverable

  • [ ] A step definition that can query any validator's database with any arbitrary SQL statement and args.

Non-goals / Non-deliverables

  • Nongoal #1
  • Nongoal #2
  • ...

General issue deliverables

  • [ ] Update the appropriate CHANGELOG(s)
  • [ ] Update any relevant local/global README(s)
  • [ ] Update relevant source code tree explanations
  • [ ] Add or update any relevant or supporting mermaid diagrams

Testing Methodology

  • [ ] Task specific tests or benchmarks: make ...
  • [ ] New tests or benchmarks: make ...
  • [ ] All tests: make test_all
  • [ ] LocalNet: verify a LocalNet is still functioning correctly by following the instructions at docs/development/README.md
  • [ ] k8s LocalNet: verify a k8s LocalNet is still functioning correctly by following the instructions here

Creator: [@dylanlott ]

dylanlott avatar May 12 '23 20:05 dylanlott

Are we pretty much going to enable "SQL injections" during local development? I like the idea as it'll make testing easier, but we should probably make sure to use a test/dev build tag to guarantee it doesn't go into production.

Olshansk avatar May 12 '23 21:05 Olshansk

I'm not exactly sure of the implementation details yet of course, but I can see that being one way this is solved. To that point, the e2e package does already use build tags by convention, so I would first point there for addressing the security concerns.

dylanlott avatar May 12 '23 22:05 dylanlott