Skip to content

Commit

Permalink
check setup digest when reusing (#566)
Browse files Browse the repository at this point in the history
* checking dirty-ness of `setUp()` in the `resolve_`function and not using user specified version if dirty

* format fixes

* Set Version: 0.1.279

* Set Version: 0.1.280

* Set Version: 0.1.281

* Update src/kontrol/foundry.py

Co-authored-by: Palina Tolmach <[email protected]>

* Set Version: 0.1.283

* Set Version: 0.1.285

---------

Co-authored-by: Tolga Ovatman <[email protected]>
Co-authored-by: devops <[email protected]>
Co-authored-by: Palina Tolmach <[email protected]>
  • Loading branch information
4 people authored May 24, 2024
1 parent 682f531 commit 6da632c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.284
0.1.285
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "kontrol"
version = "0.1.284"
version = "0.1.285"
description = "Foundry integration for KEVM"
authors = [
"Runtime Verification, Inc. <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion src/kontrol/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
if TYPE_CHECKING:
from typing import Final

VERSION: Final = '0.1.284'
VERSION: Final = '0.1.285'
16 changes: 11 additions & 5 deletions src/kontrol/foundry.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,25 +503,31 @@ def resolve_setup_proof_version(
if reinit:
if user_specified_setup_version is None:
_LOGGER.info(
f'Creating a new version of test {test} because --reinit was specified and --setup-version is not specified.'
f'Creating a new version of {test} because --reinit was specified and --setup-version is not specified.'
)
elif not Proof.proof_data_exists(f'{test}:{user_specified_setup_version}', self.proofs_dir):
_LOGGER.info(
f'Creating a new version of test {test} because --reinit was specified and --setup-version is set to a non-existing version'
f'Creating a new version of {test} because --reinit was specified and --setup-version is set to a non-existing version'
)
elif not method.up_to_date(self.digest_file):
_LOGGER.info(
f'Creating a new version of {test} because --reinit was specified and --setup-version is set to an outdated version.'
)
else:
_LOGGER.info(f'Reusing version {user_specified_setup_version} of setup proof')
effective_test_version = user_specified_setup_version
else:
latest_test_version = self.latest_proof_version(test)
effective_test_version = 0 if latest_test_version is None else latest_test_version
if user_specified_setup_version is not None and Proof.proof_data_exists(
f'{test}:{user_specified_setup_version}', self.proofs_dir
if (
user_specified_setup_version is not None
and Proof.proof_data_exists(f'{test}:{user_specified_setup_version}', self.proofs_dir)
and method.up_to_date(self.digest_file)
):
effective_test_version = user_specified_setup_version
_LOGGER.info(f'Reusing version {effective_test_version} of setup proof')

return self.check_method_change(effective_test_version, test, method)
return effective_test_version

def resolve_proof_version(
self,
Expand Down

0 comments on commit 6da632c

Please sign in to comment.