Mailing List Archive

Strategies for testing an ebuild
Hi there,

I am taking on maintaining a package in gentoo-sci overlay. What are
good ways to test that my ebuild works before creating a pull request?

I am thinking to install a Gentoo Prefix, snapshot its "vanilla" state,
and run `emerge $mypackage` in the vanilla Prefix as a test. Are there
better strategies?

Thanks,
Anton
Re: Strategies for testing an ebuild [ In reply to ]
On Tue, Oct 20, 2020, at 14:01, Anton wrote:
> Hi there,
>
> I am taking on maintaining a package in gentoo-sci overlay. What are
> good ways to test that my ebuild works before creating a pull request?
>
> I am thinking to install a Gentoo Prefix, snapshot its "vanilla" state,
> and run `emerge $mypackage` in the vanilla Prefix as a test. Are there
> better strategies?

Generally, I just `sudo ebuild <path/to/software.ebuild> clean install merge'
and test that it works directly on my system. I only proxy-maintain 1 package,
though, so others will probably have much better workflows.

Alec
Re: Strategies for testing an ebuild [ In reply to ]
On 2020.10.20 16:57, Alec Ten Harmsel wrote:
> On Tue, Oct 20, 2020, at 14:01, Anton wrote:
> > Hi there,
> >
> > I am taking on maintaining a package in gentoo-sci overlay. What are
> > good ways to test that my ebuild works before creating a pull
> request?
> >
> > I am thinking to install a Gentoo Prefix, snapshot its "vanilla"
> state,
> > and run `emerge $mypackage` in the vanilla Prefix as a test. Are
> there
> > better strategies?
>
> Generally, I just `sudo ebuild <path/to/software.ebuild> clean
> install merge'
> and test that it works directly on my system. I only proxy-maintain 1
> package,
> though, so others will probably have much better workflows.
>
> Alec

Using ebuild instead of emerge is probably not a sufficient test. It
does not check for dependencies, and I don't know what other subtle
differences there are. It's probably also good to run repoman on the
ebuild.

Jack
Re: Strategies for testing an ebuild [ In reply to ]
I've had my own overlay for a while, maintaining my own versions of
plex, new relic and even some removed packages that I use.
Until the the other day I was just making sure they install and work for
myself, I have now discovered repoman and have several issues which
actually need tidying up.
On top of this I store this in a private gitlab install so am now
looking at CI/CD to automate the testing, but at this point I'm at the
point of creating my own gentoo docker image with various things
pre-installed to start serious check/test/install of new ebuilds.

Steve.

On 20/10/2020 19:01, Anton wrote:
> Hi there,
>
> I am taking on maintaining a package in gentoo-sci overlay. What are
> good ways to test that my ebuild works before creating a pull request?
>
> I am thinking to install a Gentoo Prefix, snapshot its "vanilla"
> state, and run `emerge $mypackage` in the vanilla Prefix as a test.
> Are there better strategies?
>
> Thanks,
> Anton
>
>
>
Re: Strategies for testing an ebuild [ In reply to ]
On 2020-10-20 11:01-0700 Anton <anton.stay.connected@gmail.com> wrote:

> Hi there,
>
> I am taking on maintaining a package in gentoo-sci overlay. What are
> good ways to test that my ebuild works before creating a pull request?
>
> I am thinking to install a Gentoo Prefix, snapshot its "vanilla"
> state, and run `emerge $mypackage` in the vanilla Prefix as a test.
> Are there better strategies?

There is a package to automate this, via docker:
dev-python/ebuildtester. For other methods, see
<https://wiki.gentoo.org/wiki/Test_environment>.

Kind regards, tastytea

--
Get my PGP key with `gpg --locate-keys tastytea@tastytea.de` or at
<https://tastytea.de/tastytea.asc>.
Re: Strategies for testing an ebuild [ In reply to ]
On 10/20/2020 7:23 PM, tastytea wrote:
> On 2020-10-20 11:01-0700 Anton <anton.stay.connected@gmail.com> wrote:
>
>> Hi there,
>>
>> I am taking on maintaining a package in gentoo-sci overlay. What are
>> good ways to test that my ebuild works before creating a pull request?
>>
>> I am thinking to install a Gentoo Prefix, snapshot its "vanilla"
>> state, and run `emerge $mypackage` in the vanilla Prefix as a test.
>> Are there better strategies?
> There is a package to automate this, via docker:
> dev-python/ebuildtester. For other methods, see
> <https://wiki.gentoo.org/wiki/Test_environment>.
>
> Kind regards, tastytea
Thanks, tastytea, this is very helpful.