Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

scripts: Add the cid2civ script #562

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

poncovka
Copy link
Contributor

@poncovka poncovka commented May 30, 2023

Add a scripts that allows to download metadata about cloud images from Cloud Image Directory and prepare them for testing via Cloud Image Validation.

  • Print the supported arguments of the script:
    poetry run scripts/cid2civ --help

  • Download data about Azure images:
    poetry run scripts/cid2civ download azure > cid.json

  • Print a summary about the downloaded data:
    poetry run scripts/cid2civ analyze cid.json

  • Generate resources for the image validation:
    poetry run scripts/cid2civ convert cid.json > civ.json

TODO

  • Write tests for the script.
  • Document the script.
  • Install all dependencies.

@poncovka poncovka added the enhancement New feature or request label May 30, 2023
Copy link
Member

@miyunari miyunari left a comment

Choose a reason for hiding this comment

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

Nice - thank you for building the bridge between QE testing and the CID :) I have only one question regarding the script-thing itself :D

@@ -74,3 +74,6 @@ repos:
hooks:
- id: interrogate
args: [--fail-under=60, --verbose]
# Unable to interrogate scripts without the .py extension:
# https://github.com/econchick/interrogate/issues/104
files: \.(py)$
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need this? :) Can't we not add .py to the file instead?

@@ -48,6 +48,7 @@ pre-commit = "^3.3.2"
ipython = "^8.13.2"
pytest-sugar = "^0.9.7"
rich = "^13.3.5"
docopt = "^0.6.2"

[tool.poetry.scripts]
cloudimagedirectory-transformer = "cloudimagedirectory.transformer:run"
Copy link
Member

Choose a reason for hiding this comment

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

Does it make sense to register cid2civ here, the same way we did it with the transformer (and the old cli in the past)? :)

Add a scripts that allows to download metadata about cloud images from Cloud
Image Directory and prepare them for testing via Cloud Image Validation.

* Print the supported arguments of the script:
  poetry run scripts/cid2civ --help

* Download data about Azure images:
  poetry run scripts/cid2civ download azure > cid.json

* Print a summary about the downloaded data:
  poetry run scripts/cid2civ analyze cid.json

* Generate resources for the image validation:
  poetry run scripts/cid2civ convert cid.json > civ.json
Use local testdata using `--website file://$PWD/tests/scripts/testdata/website`.
Install docopt and requests-file as devel dependencies.
@poncovka
Copy link
Contributor Author

Update:

  • Added tests.
  • Extended documentation.
  • Poetry generates some crazy changes in the poetry.lock file.

About Nina's suggestions, my idea was to keep the script (and any future scripts) separate from your source files and keep them language-agnostic, so you don't have to change the documentation and tests if necessary. Would it be fine to merge these changes as they are for now? You can always change it.

@miyunari
Copy link
Member

For me that sounds good, @FKolwa what do you think? :)

@F-X64
Copy link
Member

F-X64 commented Jun 30, 2023

@miyunari Yes, I'm very fine with this! Feel free to merge ;)

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

Successfully merging this pull request may close these issues.

3 participants