conu icon indicating copy to clipboard operation
conu copied to clipboard

Alternative to hardcoding image names in tests

Open kmehant opened this issue 5 years ago • 14 comments

fixes #324

kmehant avatar Dec 16 '19 00:12 kmehant

Can one of the admins verify this patch?

centos-ci avatar Dec 16 '19 00:12 centos-ci

/packit copr-build

rpitonak avatar Dec 16 '19 07:12 rpitonak

[test]

rpitonak avatar Dec 16 '19 07:12 rpitonak

Congratulations! The build has finished successfully. :champagne:

You can install the built RPMs by following these steps:

  • sudo yum install -y dnf-plugins-core on RHEL 8
  • sudo dnf install -y dnf-plugins-core on Fedora
  • dnf copr enable packit/user-cont-conu-375
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

/packit build

TomasTomecek avatar Jan 07 '20 09:01 TomasTomecek

@TomasTomecek I have updated to version 31 wherever possible :)

kmehant avatar Jan 07 '20 13:01 kmehant

/packit build

TomasTomecek avatar Jan 07 '20 15:01 TomasTomecek

[test]

TomasTomecek avatar Jan 07 '20 15:01 TomasTomecek

[test]

TomasTomecek avatar Jan 09 '20 08:01 TomasTomecek

/packit build

TomasTomecek avatar Jan 09 '20 08:01 TomasTomecek

tried to run the podman tests locally and got a single error:

_____________________________________________________________________________ test_podman_image _____________________________________________________________________________
                                                                                                                                                                             
podman_backend = <conu.backend.podman.backend.PodmanBackend object at 0x7fb4aa4c3c10>                                                                                        
                                                                                                                                                                             
    def test_podman_image(podman_backend):                                                                                                                                   
        """
        Test interaction with an image
        """
        image = podman_backend.ImageClass(FEDORA_MINIMAL_REPOSITORY, tag=FEDORA_MINIMAL_REPOSITORY_TAG)
        assert "%s:%s" % (FEDORA_MINIMAL_REPOSITORY, FEDORA_MINIMAL_REPOSITORY_TAG) == image.get_full_name()
        assert "%s:%s" % (FEDORA_MINIMAL_REPOSITORY, FEDORA_MINIMAL_REPOSITORY_TAG) in image.inspect()['RepoTags']
        assert "Config" in image.inspect()
>       assert re.match(FEDORA_MINIMAL_NAME_REGEX, image.get_full_name())
E       AssertionError: assert None
E        +  where None = <function match at 0x7fb4c308b290>('fedora-minimal:([0-9])+', 'registry.fedoraproject.org/fedora-minimal:31')
E        +    where <function match at 0x7fb4c308b290> = re.match
E        +    and   'registry.fedoraproject.org/fedora-minimal:31' = <bound method PodmanImage.get_full_name of PodmanImage(repository=registry.fedoraproject.org/fedora-mini
mal, tag=31)>()
E        +      where <bound method PodmanImage.get_full_name of PodmanImage(repository=registry.fedoraproject.org/fedora-minimal, tag=31)> = PodmanImage(repository=registry
.fedoraproject.org/fedora-minimal, tag=31).get_full_name

image      = PodmanImage(repository=registry.fedoraproject.org/fedora-minimal, tag=31) 
podman_backend = <conu.backend.podman.backend.PodmanBackend object at 0x7fb4aa4c3c10>

TomasTomecek avatar Jan 09 '20 08:01 TomasTomecek

@TomasTomecek This is my local test report on total I have fixed test_buildah_image PASSED test_podman_image PASSED test_image PASSED as you have mentioned :)

test_podman.py ALL TESTS PASSED

test_buildah.py 2 TESTS FAILED
     test_buildah_image PASSED
     test_container_metadata FAILED
     test_image_metadata FAILED

test_docker.py 1 TESTS FAILED
     test_image PASSED   
     test_copy_from FAILED

kmehant avatar Jan 14 '20 05:01 kmehant

[test]

TomasTomecek avatar Jan 16 '20 14:01 TomasTomecek

/packit build

TomasTomecek avatar Jan 16 '20 14:01 TomasTomecek