Move conformance tests to plain_modules - #259
Conversation
77314a0 to
eb810dc
Compare
| console.debug(f"Cloning git repo from module {previous_module.module_name}.") | ||
|
|
||
| file_utils.delete_folder(render_context.build_folder) | ||
| git_utils.clone_repo( |
There was a problem hiding this comment.
you can update clone_repo to remove initial_files as the param is not used anymore.
There was a problem hiding this comment.
Good point. I removed that.
| with open(self.module_metadata_path(), "w", encoding="utf-8") as f: | ||
| json.dump(self.get_hashes(), f, indent=4) | ||
|
|
||
| def truncate_metadata_functionalities(self, frid: str | None) -> None: |
There was a problem hiding this comment.
I would think about extracting the methods that work with metadata file to a separate file. Something similar to git_utils. WDYT?
There was a problem hiding this comment.
I extracted those functions that work with the module_metadata file
| with open(self.module_metadata_path(), "w", encoding="utf-8") as f: | ||
| json.dump(metadata, f, indent=4) | ||
|
|
||
| def revert_code_to_frid(self, frid: str | None) -> None: |
There was a problem hiding this comment.
As this method is not atomic it can be stopped in between git action and writing the metadata, I would recommend checking if metadata and git are in sync when starting the rendering. If they are not, we should fall back to last frid that is both implemented in git and contained in metadata.
Does this make sense?
There was a problem hiding this comment.
Yeah, definitely makes sense. Checking if they are in sync before rendering makes sense and is low cost for the user even if it happens (should be super rare though).
I pushed a commit with this change. I tested by manually messing with the git repo in the code/ directory. What I did is a silent reconciliation before rendering. The user doesn't even get notified and the rendering just continues from the last implemented FRID that is in git and in metadata.
pedjaradenkovic
left a comment
There was a problem hiding this comment.
Left a minor comment, it should be good to go!
There was a problem hiding this comment.
I think you can remove this initial_files as well.
3d45926 to
d89fdf2
Compare
This changes the structure of the
plain_modulesand removes theconformance_testsdirectory.Side effects:
--conformance-tests-folderCLI argument is removed. Outputs from older versions re-render from scratch automatically; the old top-level conformance_tests/ folder can be deleted by hand.module_metadata.jsonfile is not version controlled anymore (previously it was inside the module which is version controlled)I tested:
plain_modulesstructure--render-fromInput from you:
plain_modulesthen they'll have to include thecode/part from now on.