-
Notifications
You must be signed in to change notification settings - Fork 8
Improve pipeline #677
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
base: develop
Are you sure you want to change the base?
Improve pipeline #677
Conversation
use manager for all runs use manager for all runs use manager for all runs use manager for all runs use manager for all runs use manager for all runs use manager for all runs use manager for all runs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned in the other PR, I believe this goes beyond the scope of the original issue.
While I understand the intent behind this proposal, it feels somewhat overcomplicated for our current needs and would require significant effort to adapt across all repositories.
I’m also concerned that it may not be very intuitive for quick adoption.
Additionally, as noted in the PR description, further development in the test manager is needed before this approach can be broadly useful.
| * folder: Folder path to change to (optional) | ||
| * body: Closure to execute inside the folder | ||
| */ | ||
| def runInFolder(folder = null, body) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the point of this method is to run a piece of code in a folder, why is folder optional?
| activateCmd = "call ${venvName}\\Scripts\\activate\n " | ||
| } | ||
| this.runInFolder(workingDir) { folderCtx -> | ||
| folderCtx.run(activateCmd + cmd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is activateCmd + cmd concatenating commands or doing something else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, cd folder and python activation are the exceptions to the rule we are doing.
Although we can explore to avoid the activate cmd with the point I mention on the PR:
- Try to initialize (maybe it's not possible) the venv without the activate script. The activate script only modifies some env variables that could be set with withEnv()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does it have to be an exception?
What is the difference with the rest of commands that don't need to be concatenated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because it retains a context in the powershell and luckily the exit code is not as relevant in terms of validation. Its not that i dont want to get rid of it, its that i dont see how
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because it retains a context in the powershell and luckily the exit code is not as relevant in terms of validation. Its not that i dont want to get rid of it, its that i dont see how
| def wiresharkScope = "" | ||
| def clearSuccessfulWiresharkLogs = true | ||
| def startWiresharkTimeoutS = 10.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to configure each of these in each pipeline, we could add that to the constructor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are public attributes. runPythonVersions is modified for example:
https://github.com/ingeniamc/ingenialink-python/pull/677/changes#diff-e6ffa5dc854b843b3ee3c3c28f8eae2f436c2df2b1ca299cca1fa5982e390cf8R449
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be clear, there's a lot of work to be done specially on the pytestManager to make it generic enought to be migrated to cicdlib. I have focused on the venvmanager but it was easier to wrap this here locally too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just pointing that same as runPythonVersions, this should be there too.
If you intend to merge this PR, I would not leave the pytestManager half way. I would add everything we need to be configurable, or remove it and leave it for the future.
| def lin_marker = markersExcludeString(HARDWARE_MARKERS + ["virtual", "no_pcap"]) | ||
| venvManager.withPython(DEFAULT_PYTHON_VERSION, env.WORKING_FOLDER) { venv -> | ||
| venv.run("poetry run poe install-wheel") | ||
| venv.run("""poetry run poe tests --junitxml=pytest_reports/junit-tests-${venv.name}.xml --junit-prefix=${venv.name} -m '${lin_marker}' -o log_cli=True""") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why """ is needed here rather than single quotes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably not needed. I've been mininmal regarding what to change in the pipeline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean with "what to change in the pipeline"?
Isn't this line a new addition from this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
those lines have been changed, not fully new. but yes, we can change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
those lines have been changed, not fully new. but yes, we can change
| sh """ | ||
| mkdir -p pytest_reports | ||
| cp ${LIN_DOCKER_TMP_PATH}/pytest_reports/* pytest_reports/ | ||
| cp ${env.WORKING_FOLDER}/pytest_reports/* pytest_reports/ | ||
| """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't we need to change this to single-line commands as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at some point we should
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not now? Isn't it possible with the architecture you proposed?
| """ | ||
| venvManager.forPythons(env.WORKING_FOLDER, testManager.runPythonVersions) { venv -> | ||
| venv.run("poetry run poe install-wheel") | ||
| venv.run("""poetry run poe tests --junitxml=pytest_reports/junit-tests-${venv.version}.xml --junit-prefix=${venv.version} -m virtual --setup summit_testing_framework.setups.virtual_drive.TESTS_SETUP -o log_cli=True""") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question regarding the quotes
| sh """ | ||
| mkdir -p pytest_reports | ||
| cp ${LIN_DOCKER_TMP_PATH}/pytest_reports/* pytest_reports/ | ||
| cp ${env.WORKING_FOLDER}/pytest_reports/* pytest_reports/ | ||
| """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't we need to change this to single-line commands as well?
Description
This pull request is a proposal to organize pipelines that depend on venvs and poetry. It has been implemented here as a previous step to demonstrate that this can be done with groovy closure patterns as a previous step to migrate it to cicdlib.
Type of change
Please add a description and delete options that are not relevant.
I will also list some possible improvements that could be done. I would encourage that this be done before the migration:
Tests
Please describe the manual tests that you ran to verify your changes if it applies.
Documentation
Please update the documentation.
[Unreleased]section of the CHANGELOG.