Skip to content

Run tests for all target types#185

Merged
TomasTomecek merged 6 commits intouser-cont:masterfrom
lachmanfrantisek:better-tests
Sep 19, 2018
Merged

Run tests for all target types#185
TomasTomecek merged 6 commits intouser-cont:masterfrom
lachmanfrantisek:better-tests

Conversation

@lachmanfrantisek
Copy link
Copy Markdown
Member

  • Use coverage for tests.
  • Run tests on all target types.
  • Use name parameter for all targets.

Signed-off-by: lachmanfrantisek <flachman@redhat.com>
Signed-off-by: lachmanfrantisek <flachman@redhat.com>
Signed-off-by: lachmanfrantisek <flachman@redhat.com>
Signed-off-by: lachmanfrantisek <flachman@redhat.com>
Signed-off-by: lachmanfrantisek <flachman@redhat.com>
Copy link
Copy Markdown
Member

@TomasTomecek TomasTomecek left a comment

Choose a reason for hiding this comment

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

Overall, you upped the code quality greatly. Just a few questions: I request answers, not necessarily changes.

Comment thread colin/core/target.py Outdated
self.insecure = insecure
self.image_name = ImageName.parse(target)
self.image_name_obj = ImageName.parse(target)
self.name = self.image_name_obj.name
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These 3 lines are well done: it could really bite as badly if we changed a type of one of the attributes (happened to me recently actually in another project)

The only thing I don't like is the name "name": it's way too generic. If I didn't know the code, I would expect that self.name is the __repr__ name of the target class, not the target name itself.

We can leave it as it is, this is just a small observation.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Any suggestions for the name name? I need something general matching also Dockerfiles...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It is always like this:

    def __init__(self, target, **_):
        super().__init__()
        self.name = target

What about target / source_name / target_source?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

target would indicate instance of Target.
source_name LGTM
target_source feels complicated to me.
or just target_name


cmd = ["podman", "push", image_name, skopeo_target]
subprocess.check_call(cmd)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this diff warms my heart

# "cmd_or_entrypoint": "PASS",
# "no_root": "FAIL",
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

what about the cmd_or and no_root checks? will they work with podman?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

  • no_root will work without changes
  • cmd_or_entrypoint will need some small changes (The config dictionary has a slightly different format.)

I can add them in the other pull request.

@TomasTomecek
Copy link
Copy Markdown
Member

Let me know which changes you intend to make and I'll merge once all is cool.

@lachmanfrantisek
Copy link
Copy Markdown
Member Author

@TomasTomecek I'll change the name, but no_root/cmd_or_entrypoint needs dome testing so I leave it for the other pr .

Signed-off-by: lachmanfrantisek <flachman@redhat.com>
@lachmanfrantisek
Copy link
Copy Markdown
Member Author

@TomasTomecek I am done for now...

@user-cont user-cont deleted a comment Sep 19, 2018
@TomasTomecek
Copy link
Copy Markdown
Member

TomasTomecek commented Sep 19, 2018

Nicely done, let's unleash the tests!
Edit: I give up, gifs don't work :< The gif

@TomasTomecek TomasTomecek merged commit f1e830c into user-cont:master Sep 19, 2018
@lachmanfrantisek lachmanfrantisek deleted the better-tests branch September 19, 2018 11:37
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.

2 participants