Subject: | Test fail with stripped-down users |
#65301 got closed when the additional, related failure I reported had not yet been fixed. It’s still broken as of File-HomeDir-1.002. My message from that ticket:
On Mon Jan 30 01:13:43 2012, SPROUT wrote:
Show quoted text
> On Mon Jan 31 17:09:50 2011, ADAMK wrote:
The failures I’m getting look like this:
# Failed test 'Our videos directory exists'
# at t/02_main.t line 244.
# Failed test 'Our videos directory exists'
# at t/02_main.t line 245.
# Looks like you failed 2 tests of 39.
t/02_main.t ........... Dubious, test returned 2 (wstat 512, 0x200)
I suggest simply skipping the test. It assumes too much.
(BTW, it’s this six-year-old-and-older bug that led me to write File::HomeDir::Tiny.)
> > I believe this is now fixed in the latest dev release.
> >
> > Please re-open if you still have issues with 0.96_03
>
> I’m afraid it’s not fixed. root is not the only user without special
> directories. This logic can’t
> be right, for several reasons. I have a stripped down user similar to
> what you test for under
> AUTOMATED_TESTING, but without having that env var set, because I’m
> not automating
> testing. So I always get test failures. Also, $< != 0 does not
> indicate a normal user. www,
> for instance, doesn’t have any special directories. So I would simply
> suggest skipping this
> test altogether. All it does is guarantee that File::HomeDir won’t
> install in many places.
>
> } elsif (
> $^O eq 'darwin'
> ) {
> # "Unixes with proper desktops" special cases
> if ( $ENV{AUTOMATED_TESTING} ) {
> # Automated testers on Mac (notably BINGOS) will often
> have
> # super stripped down testing users.
> $HAVEHOME = 1;
> $HAVEDESKTOP = 1;
> $HAVEMUSIC = 0;
> $HAVEPICTURES = 0;
> $HAVEVIDEOS = 0;
> $HAVEOTHERS = 1;
> } elsif ( $< ) {
> # Normal user
> $HAVEHOME = 1;
> $HAVEDESKTOP = 1;
> $HAVEMUSIC = 1;
> $HAVEPICTURES = 1;
> $HAVEVIDEOS = 1;
> $HAVEOTHERS = 1;
> } else {
> # Root can only be relied on to have a home
> $HAVEHOME = 1;
> $HAVEDESKTOP = 0;
> $HAVEMUSIC = 0;
> $HAVEPICTURES = 0;
> $HAVEVIDEOS = 0;
> $HAVEOTHERS = 0;
> }