[Pkg-shadow-devel] Contributing to shadow-uitls with pytest cases

Serge E. Hallyn serge at hallyn.com
Sat May 1 18:38:25 BST 2021


Hi,

so what is the goal here?  I don't see any sssd related tests.  Is this
purely intended to move testcases to pytest?

The pytest boilerplate seems to obfuscate the actual testing.  If we do
go with pytest, then I would hope that we can get some of that out of the
way so that the thing being tested and the results being checked are more
front and center.

I'll grant you the existing testsuite is extensive and can be very hard to
debug.  However, it's not as bad as I had previously thought.  The biggest
obstacle I've had is it's use of uids > 65535 which makes running them in
containers a challenge.

One thing the existing testsuite does is attempt to keep the tests from
leaving the host in a bad state.  So they copy in test configuration and
copy the pre-existing config back in when done.  While that's not needed
if we run in a container, it does make it safer to run in a long-lived
test container or even a host.

-serge

On Thu, Apr 29, 2021 at 05:31:19PM +0200, Iker Pedrosa wrote:
> Hi Serge and community,
> 
> Thank you for your patience. We've been discussing and we've decided to
> simplify the proposal. On the one hand, there isn't any need for an
> external dependency except for pytest. So, we'll include the tests inside
> the tests folder. An example in a PR:
> https://github.com/shadow-maint/shadow/pull/326.
> 
> On the other hand, we'd like to execute those tests in the CI for the PRs.
> Thus, we'll investigate how to include them in travis.
> 
> What do you think?
> 
> On Fri, Apr 23, 2021 at 4:54 PM Anuj Borah <aborah at redhat.com> wrote:
> 
> >
> >
> > On Fri, Apr 23, 2021 at 4:48 PM Iker Pedrosa <ipedrosa at redhat.com> wrote:
> >
> >> Hi Anuj,
> >>
> >> I'm having difficulties understanding your proposal.
> >>
> >> On Fri, Apr 23, 2021 at 7:31 AM Anuj Borah <aborah at redhat.com> wrote:
> >>
> >>> Hi,
> >>>
> >>> After discussing with our team, we have decided that we will test and
> >>> review the pytest script on sssd CI platform then we will send the scripts
> >>> to : https://github.com/shadow-maint/shadow/tree/master/tests
> >>>
> >>> sssd repo: https://github.com/SSSD/sssd
> >>>
> >>>
> >> IIUC, you are proposing to check that the test scripts are correctly
> >> executed by opening a PR in sssd repository. But what about the peer
> >> review? Where will it happen? I think that the right place to do it is
> >> shadow-utils repository.
> >>
> >
> > If we go ahead with this , Yes , scripts will be reviewed by sssd qe(sssd
> > PR) , then on shadow-utils repository(shadow-utils PR).
> >
> >
> >>
> >>
> >>>
> >>> This is because there are very few bash shadow utils test cases here
> >>> with us that will be ported to pytest and if we try to configure new CI on
> >>> shadow utils repo it will take much more time and effort , which does not
> >>> make sense for a very few test cases . Our sssd CI is configured and
> >>> working which we would like to utilize for this task .
> >>>
> >>> For every PR sent to shadow utils repo we will attach the PR send for CI
> >>> test and review on sssd repo.
> >>>
> >>
> >> IIUC, what you are proposing is that the shadow-utils PRs will have some
> >> type of mirror in the sssd repository to be able to test them using the CI
> >> included in that repository? Isn't this more difficult than configuring the
> >> CI directly in the shadow-utils repository?
> >>
> >
> > As discussed with you, we will discuss this at our sssd meeting thurse day.
> >
> >
> >>
> >>
> >>>
> >>> Please let me know what you think ?
> >>>
> >>> Regards
> >>> Anuj Borah
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> On Mon, Apr 19, 2021 at 5:20 PM Serge E. Hallyn <serge at hallyn.com>
> >>> wrote:
> >>>
> >>>> On Mon, Apr 19, 2021 at 04:27:58PM +0530, Anuj Borah wrote:
> >>>> > Hi
> >>>> >
> >>>> > We have some bash test cases for shadow utils which we are porting to
> >>>> > pytest .
> >>>> >
> >>>> > I have visited :
> >>>> https://github.com/shadow-maint/shadow/tree/master/tests
> >>>> >
> >>>> > There I can see tests are in c and bash .
> >>>> >
> >>>> > So my questions will be :
> >>>> >
> >>>> > 1. Is it possible to put pytest cases on upstream shadow utils repo.
> >>>>
> >>>> Yes, that would be great.
> >>>>
> >>>> > 2. Is it possible to import our sssd test library there to run those
> >>>> test
> >>>> > cases on CI .
> >>>>
> >>>> Should be, yeah.
> >>>>
> >>>> > Please let me know.
> >>>> >
> >>>> >
> >>>> > Regards
> >>>> > Anuj Borah(redhat QE sssd )
> >>>>
> >>>> > _______________________________________________
> >>>> > Pkg-shadow-devel mailing list
> >>>> > Pkg-shadow-devel at alioth-lists.debian.net
> >>>> >
> >>>> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-shadow-devel
> >>>>
> >>>> _______________________________________________
> >>> Pkg-shadow-devel mailing list
> >>> Pkg-shadow-devel at alioth-lists.debian.net
> >>> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-shadow-devel
> >>>
> >>
> >>
> >> --
> >>
> >> Iker Pedrosa
> >>
> >> Software Engineer, Identity Management team
> >>
> >> Red Hat <https://www.redhat.com>
> >> <https://www.redhat.com>
> >>
> >
> 
> -- 
> 
> Iker Pedrosa
> 
> Software Engineer, Identity Management team
> 
> Red Hat <https://www.redhat.com>
> <https://www.redhat.com>



More information about the Pkg-shadow-devel mailing list