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

Tox Generic / Unit Test #219

Closed
wants to merge 5 commits into from
Closed

Tox Generic / Unit Test #219

wants to merge 5 commits into from

Conversation

cts-zeero
Copy link
Contributor

Purpose

Adding python tox generic and python tox unit test step implementer.

Breaking?

No

Integration Testing

Tested a local python tox test environment command execution to confirm the tests ran succesfully against the tox.ini configuration file.

  • Tox generic makes no assumption about installed packages or commands defined in the tox.ini. It simply calls the target tox environment defined in the tox_env configuration parameter and executes the associated .ini config.
  • The tox unit-test step implementer defaults to test for the tox_env parameter.

cts-dev and others added 3 commits August 31, 2021 18:00
update cz json file assertion message

add regex replace for non-digit version characters

remove TypeError check in place of validation assertion

refactor to make tag check more reliable

update inline doc

add EOF newline

add test mocks and resolve lint errors

adding additional-helm-values-files var

Add unit test for new param: 'additional-helm-values-files'

remove duplicate argocd test method

add argocd test newline
@codecov
Copy link

codecov bot commented Sep 21, 2021

Codecov Report

Merging #219 (7e076ba) into main (14ee488) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #219   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           84        87    +3     
  Lines         3479      3556   +77     
=========================================
+ Hits          3479      3556   +77     
Flag Coverage Δ
pytests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...tep_runner/step_implementers/shared/tox_generic.py 100.00% <100.00%> (ø)
...tep_runner/step_implementers/unit_test/__init__.py 100.00% <100.00%> (ø)
...tep_runner/step_implementers/unit_test/tox_test.py 100.00% <100.00%> (ø)
src/ploigos_step_runner/utils/tox.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 14ee488...7e076ba. Read the comment docs.

@itewk
Copy link
Contributor

itewk commented Sep 21, 2021

@cts-zeero can you collapse down your commits and get rid of the merge commits for a clean history?

@itewk
Copy link
Contributor

itewk commented Sep 21, 2021

Tox generic makes no assumption about installed packages or commands defined in the tox.ini. It simply calls the target tox environment defined in the tox_env configuration parameter and executes the associated .ini config.

does that mean as part of the ToxGeneric we should also be calling some other target to install dependecies? or have another StepImplmenter specific for caling a target for installing dependeices?, or assume the target will install its own dependieces?

@cts-zeero
Copy link
Contributor Author

Working on the rebase now.

Tox generic will call tox with the -e <env> argument so any dependencies defined inside of the tox.ini should be installed during the tox environment setup.

As far as tox itself, that would have to be installed in the step container before executing the step.

@itewk
Copy link
Contributor

itewk commented Sep 21, 2021

Tox generic will call tox with the -e argument so any dependencies defined inside of the tox.ini should be installed during the tox environment setup.

k

As far as tox itself, that would have to be installed in the step container before executing the step.

@cts-zeero so sounds like we need a ploigos-tool-python container image with tox in it then in our ploigos-containers project.

@cts-zeero
Copy link
Contributor Author

I think the container image will be needed for sure.

@cts-zeero
Copy link
Contributor Author

cts-zeero commented Sep 21, 2021

For whatever reason this commit <ff2c29b1fd128d70875ca66316e96a000c91259c> keeps complaining when I try to rebase.

The previous cherry-pick is now empty, possibly due to conflict resolution.

@cts-zeero
Copy link
Contributor Author

Do you want me to squash all the way back to <f12384d2b0ce78a98e37c7bf185ed720b9da10c6>?

f12384d?

@itewk
Copy link
Contributor

itewk commented Sep 21, 2021

@cts-zeero i know its annoying, but when all else fails with re-basing, can you just copy the 7 changed files out to a temp dir, re-create the branch from main, and then copy the files back to create a new clean commit?

@itewk itewk self-requested a review September 22, 2021 12:45
@itewk itewk assigned itewk and cts-zeero and unassigned itewk Sep 22, 2021
@itewk itewk added the enhancement New feature or request label Sep 22, 2021
@cts-zeero
Copy link
Contributor Author

I am getting test failures after directly cloning the main branch.

========================================================================================= FAILURES =========================================================================================
___________________________________________________________ TestStepWorkflowResultTest.test_write_results_to_json_file_exception ___________________________________________________________

self = <test_workflow_result.TestStepWorkflowResultTest testMethod=test_write_results_to_json_file_exception>

>   ???
E   AssertionError: RuntimeError not raised

/workspaces/ploigos-step-runner/tests/results/test_workflow_result.py:785: AssertionError
___________________________________________________________ TestStepWorkflowResultTest.test_write_results_to_yml_file_exception ____________________________________________________________

self = <test_workflow_result.TestStepWorkflowResultTest testMethod=test_write_results_to_yml_file_exception>

>   ???
E   AssertionError: RuntimeError not raised

/workspaces/ploigos-step-runner/tests/results/test_workflow_result.py:543: AssertionError

@itewk
Copy link
Contributor

itewk commented Sep 22, 2021

@cts-zeero hrmm. i just pulled main and ran the tests and they are all passing. Did you try runing the tests against main without your changes to verify they run clean on your system as is right now?

@cts-zeero
Copy link
Contributor Author

Yea I cloned without changes and tested. Let me check something else.

I doubt the tests are broken, given that they would have failed the PR checks. I wanted to make sure it was just me first.

@itewk
Copy link
Contributor

itewk commented Sep 23, 2021

@cts-zeero heyo. so i pulled your branch down locally, re-based on the latest from main and then pushed up to my own branch (https://github.com/itewk/ploigos-step-runner/tree/feature/tox). Tests and linting all pass locally for me.

I can either re-create this PR from my fork/branch, or you can pull my fork/branch and reset your fork/branch to my rebase, or you can do the same rebase.

@cts-zeero
Copy link
Contributor Author

Lets use your branch since it is already working. I will update my main fork once we merge it in.

@itewk
Copy link
Contributor

itewk commented Sep 27, 2021

this will be replaced by #223

@itewk itewk closed this Sep 27, 2021
@itewk
Copy link
Contributor

itewk commented Sep 27, 2021

merged #223

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants