Skip to content

Move conformance tests to plain_modules - #259

Merged
NejcS merged 1 commit into
mainfrom
impr/move_conf_tests_to_modules
Jul 30, 2026
Merged

Move conformance tests to plain_modules#259
NejcS merged 1 commit into
mainfrom
impr/move_conf_tests_to_modules

Conversation

@NejcS

@NejcS NejcS commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

This changes the structure of the plain_modules and removes the conformance_tests directory.

├── plain_modules
│   ├── <module_1>
│   │   ├── .codeplain
│   │   │   └── module_metadata.json
│   │   ├── .memory
│   │   │   └── conformance_test_memory
│   │   ├── code
│   │   │   ├── .git
│   │   │   ├── <the code>
│   │   └── tests
│   │   │   ├── .git
│   │   │   ├── <the conformance tests>

Side effects:

  • The --conformance-tests-folder CLI argument is removed. Outputs from older versions re-render from scratch automatically; the old top-level conformance_tests/ folder can be deleted by hand.
  • The module_metadata.json file is not version controlled anymore (previously it was inside the module which is version controlled)

I tested:

  • on multimodule examples
  • rerendering a project that has the old plain_modules structure
  • rerendering with --render-from
  • rerendering with change detection (changed a functionality)
  • rendering without conformance tests

Input from you:

  • Any other test scenarios that I should test?
  • This seems backwards compatible; users don't need to do anything, the copied built code stays in the same place. But if they expct to get the code from the plain_modules then they'll have to include the code/ part from now on.
  • Any docs or references that I should update?

@NejcS
NejcS force-pushed the impr/move_conf_tests_to_modules branch from 77314a0 to eb810dc Compare July 23, 2026 08:34
@NejcS
NejcS requested a review from pedjaradenkovic July 23, 2026 10:09
@NejcS NejcS self-assigned this Jul 23, 2026
console.debug(f"Cloning git repo from module {previous_module.module_name}.")

file_utils.delete_folder(render_context.build_folder)
git_utils.clone_repo(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

you can update clone_repo to remove initial_files as the param is not used anymore.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point. I removed that.

Comment thread plain_modules.py
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:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would think about extracting the methods that work with metadata file to a separate file. Something similar to git_utils. WDYT?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I extracted those functions that work with the module_metadata file

Comment thread plain_modules.py
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:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

@NejcS
NejcS requested a review from pedjaradenkovic July 29, 2026 12:57

@pedjaradenkovic pedjaradenkovic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Left a minor comment, it should be good to go!

Comment thread git_utils.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you can remove this initial_files as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤦 thanks

@NejcS
NejcS force-pushed the impr/move_conf_tests_to_modules branch from 3d45926 to d89fdf2 Compare July 30, 2026 08:43
@NejcS
NejcS merged commit 97f2c50 into main Jul 30, 2026
10 checks passed
@NejcS
NejcS deleted the impr/move_conf_tests_to_modules branch July 30, 2026 08:47
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.

2 participants