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

♻️ tests refactoring #41

Merged
merged 9 commits into from
Aug 25, 2022
Merged

♻️ tests refactoring #41

merged 9 commits into from
Aug 25, 2022

Conversation

bal7hazar
Copy link
Contributor

Fix #40

AbdelStark
AbdelStark previously approved these changes Aug 19, 2022
Copy link
Collaborator

@AbdelStark AbdelStark left a comment

Choose a reason for hiding this comment

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

lgtm

- add minter.feature
- add yielder.feature
- add gherkin context into yielder tests
- update yielder unit tests to match new format
- add minter test initialization (which test views)
- fix typo
@bal7hazar bal7hazar marked this pull request as ready for review August 22, 2022 12:31
@bal7hazar
Copy link
Contributor Author

Note: CI passed since it ran before the latest version of protostar, if we merge as it is the CI will fail after merge since protostar version hasn't been upgraded in this branch. I suggest to merge as it is then fix the CI with the next PR (fixing the protostar version).

@bal7hazar bal7hazar requested review from cloudvenger and removed request for AbdelStark August 23, 2022 12:45
tests/integrations/minter/config.yml Outdated Show resolved Hide resolved
tests/integrations/yield/config.yml Outdated Show resolved Hide resolved
tests/units/minter/config.yml Outdated Show resolved Hide resolved
- create config file at each folder level
- create a python file to mutualize hints code
update(config, yaml.safe_load(file_instance))

# set up context
context = objectify(context, config)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I implemented the config proposition as expected.

Additionaly, I created a python file to capitalize code from cairo hints (especially in setup functions). Then objects got from config files are homogenous for all tests.

Note: Given the following use case:

(tests) - config.yml:

key:
  some: text

(tests/folder) - config.yml:

key:
  other: text

The loading will merge key contents instead of overriding those (which is more convenient), so we have the following config instantiated:

key:
  some: text
  other: text

Copy link
Contributor

Choose a reason for hiding this comment

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

Perfect for me.

update(config, yaml.safe_load(file_instance))

# set up context
context = objectify(context, config)
Copy link
Contributor

Choose a reason for hiding this comment

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

Perfect for me.

@bal7hazar bal7hazar merged commit e594ee3 into Carbonable:main Aug 25, 2022
@bal7hazar bal7hazar deleted the 40-test-refactoring branch August 25, 2022 07:06
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.

Test refactoring
3 participants