This repository was archived by the owner on Apr 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Convert task to Standard Interface style task #44
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
b405c1f
convert to ansiblized Taskotron (generic) task
kparal 640cf7e
create artifacts/taskotron in playbook
kparal d762ac8
download only supported architectures
kparal 8df2176
allow to download build.log
kparal 70978fb
Reenable the integration tests, use mock
hroncok d5f0afe
Add --cap-add=SYS_ADMIN to docker on Tarvis
hroncok 3e4d8e5
Don't use nspawn
hroncok b2f95c8
Document running in mock
hroncok 8ef4147
Don't use shebangs
hroncok 50a0916
Fix style issues in download_rpms.py
hroncok 4b2cd96
Use a dedicated mock root
hroncok 6e46a8b
Remove unneeded packages from Docker
hroncok 57253da
bugzilla needs requests but does not specify it
hroncok d20272e
Error if mock shell ends with unexpected exitcode
hroncok 118f8c6
For each nevr, use it's own artifacts directory
hroncok 8601f68
Add a --fake switch for integration tests
hroncok 71cce32
Add artifacts directory to gitignore for direct runs
irushchyshyn 5b945f1
Update tests section in README
irushchyshyn 651975d
Add generated tests.retry file to gitignore
irushchyshyn dbc9ac1
Document how to use --fake option in integration tests
irushchyshyn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # -*- coding: utf-8 -*- | ||
|
|
||
| '''Download correct NVRs for python-versions to operate on.''' | ||
|
|
||
| import sys | ||
| import logging | ||
| from libtaskotron.directives import koji_directive | ||
|
|
||
|
|
||
| def download_rpms(koji_build, rpmsdir, arch=['x86_64'], arch_exclude=[], | ||
| src=True, debuginfo=False, build_log=True): | ||
| '''Download RPMs for a koji build NVR.''' | ||
|
|
||
| koji = koji_directive.KojiDirective() | ||
|
|
||
| print('Downloading rpms for %s into %s' % (koji_build, rpmsdir)) | ||
| params = { | ||
| 'action': 'download', | ||
| 'koji_build': koji_build, | ||
| 'arch': arch, | ||
| 'arch_exclude': arch_exclude, | ||
| 'src': src, | ||
| 'debuginfo': debuginfo, | ||
| 'target_dir': rpmsdir, | ||
| 'build_log': build_log, | ||
| } | ||
| arg_data = {'workdir': None} | ||
| koji.process(params, arg_data) | ||
|
|
||
| print('Downloading complete') | ||
|
|
||
|
|
||
| if __name__ == '__main__': | ||
| print('Running script: %s' % sys.argv) | ||
| logging.basicConfig() | ||
| logging.getLogger('libtaskotron').setLevel(logging.DEBUG) | ||
| args = {} | ||
|
|
||
| # arch is supposed to be a comma delimited string, but optional | ||
| arches = sys.argv[3] if len(sys.argv) >= 4 else '' | ||
| arches = [arch.strip() for arch in arches.split(',')] | ||
| if arches: | ||
| print('Requested arches: %s' % arches) | ||
| args['arch'] = arches | ||
|
|
||
| download_rpms(koji_build=sys.argv[1], | ||
| rpmsdir=sys.argv[2], | ||
| **args | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| include('/etc/mock/fedora-27-x86_64.cfg') | ||
|
|
||
| config_opts['chroot_setup_cmd'] = 'install ansible dnf' | ||
| config_opts['use_host_resolv'] = True | ||
| config_opts['rpmbuild_networking'] = True | ||
| config_opts['use_nspawn'] = False | ||
| config_opts['root'] = 'fedora-27-x86_64-taskotron' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Not sure why this gets removed.
An own directory gets created for each nevr only during integration tests so far. When running
ansible-playbook ...command the results get saved toartifacts.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.
Are you overriding
artifactsvariable on the command line?ansible-playbook ... -e artifacts=pathThere 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.
Nevermind, maybe I misunderstood the question. Either way, I also believe it's better to keep this in .gitignore. When somebody runs the playbook with default vars, that's where the artifacts get created.
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 am not overriding
artifacts, I just took README and tried running as it says :)I will add it back.
Besides, while
test.loggets overridden with each subsequent run,output.logkeeps previous results (also with default vars).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.
ok, get it back, my bad, I haven't considered direct runs.
Uh oh!
There was an error while loading. Please reload this page.
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.
@irushchyshyn When running it locally, it's your duty to clear artifacts dir (or not). The task can't know your intended use case. Of course, you can e.g. generate random artifacts dir paths inside the playbook (the same way it generates workdirs), in case the variable is not set externally. It's your task, you can do whatever you prefer for local runs :) Local runs are mostly for development.
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.
@kparal thanks for explanation.