Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-35551: fix ConfigurableAction tests and make serialization deterministic #699

Merged
merged 2 commits into from Jul 14, 2022

Conversation

TallJimbo
Copy link
Member

No description provided.

@TallJimbo TallJimbo force-pushed the tickets/DM-35551 branch 2 times, most recently from 19d3f08 to 2b33945 Compare July 13, 2022 22:55
Copy link
Contributor

@erykoff erykoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine as far as I can tell, but I'm curious what was wrong with the old test configs?

@TallJimbo
Copy link
Member Author

It's in the commit message: the problem is that they weren't importable, and configs need to be in order to be deserialized (which the tests need to do).

Tests for serialization were doing nothing, because:

- the config values in the test were set up entirely by the class
  constructor, which is called directly before reading the saved
  config;
- the test was using StringIO.read() instead of StringIO.getvalue(),
  which returns an empty string unless you seek back to the beginning
  of the buffer, and hence we were reading an empty string.

But fixing that was nontrivial, because the classes used in those tests
were defined in the test script, and hence weren't importable (and all
config persistence needs to be able to import the config class and
fields).  So those test classes have been moved to a tests module.
@TallJimbo TallJimbo merged commit 2103b67 into main Jul 14, 2022
@TallJimbo TallJimbo deleted the tickets/DM-35551 branch July 14, 2022 03:26
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.

None yet

2 participants