CI: Skip permissions test when running as sudo
State: closed

Closes https://github.com/pandas-dev/pandas/issues/33210

Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: CI
description: Continuous Integration

Comments:
Is this a known failure?

```
=================================== FAILURES ===================================

__________________ TestHDFStore.test_append_with_data_columns __________________

[gw0] linux -- Python 3.6.6 /home/travis/miniconda3/envs/pandas-dev/bin/python

self = <pandas.tests.io.pytables.test_store.TestHDFStore object at 0x7fbb644fd588>

setup_path = 'tmp.__PzdfGEaMNt__.h5'

    def test_append_with_data_columns(self, setup_path):
...
            result = store.select(

                "df", "string='foo' and string2='foo' and A>0 and B<0"

            )

            expected = df_new[

                (df_new.string == "foo")

                & (df_new.string2 == "foo")

                & (df_new.A > 0)

                & (df_new.B < 0)

            ]

>           tm.assert_frame_equal(result, expected, check_index_type=False)

E           AssertionError: (None, <17 * BusinessDays>)
```

Restarting CI to see.
Looks like the Travis failure is from one of the newly-implemented freq checks.  Should be unrelated.  I'll try to track that down.
Is chmod(0) even valid? Wonder if we are just using the wrong bit setting and instead shouldn't do something like `chmod("u-r")`
On my system, that results in a file with these permissions.

```
----------  1 taugspurger  wheel     0B Apr 28 08:22 a
```
Yea not sure that is specified by POSIX though; at least according to Wikipedia I don’t see anything about that, so perhaps the lack of a standard could explain why it doesn’t appear to work on all systems:

https://en.wikipedia.org/wiki/Chmod <https://en.wikipedia.org/wiki/Chmod>

> On Apr 28, 2020, at 8:57 AM, Tom Augspurger <notifications@github.com> wrote:
> 
> 
> On my system, that results in a file with these permissions.
> 
> ----------  1 taugspurger  wheel     0B Apr 28 08:22 a
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub <https://github.com/pandas-dev/pandas/pull/33847#issuecomment-620695373>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAEU4UL2G4HBCRU66QU6ZSDRO34FBANCNFSM4MS2RIUA>.
> 

William Ayd
william.ayd@icloud.com




could do an `os.geteuid() == 0` check?
I'm happy with the skip as written.

On Tue, Apr 28, 2020 at 11:03 AM jbrockmendel <notifications@github.com>
wrote:

> could do an os.geteuid() == 0 check?
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/pandas-dev/pandas/pull/33847#issuecomment-620699254>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAKAOIWGFTKCXOGQP43TAQDRO3433ANCNFSM4MS2RIUA>
> .
>

this lgtm.
Thanks @TomAugspurger 
@Meeseeksdev backport to 1.0.x


Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

1. Checkout backport branch and update it.

```
$ git checkout 1.0.x
$ git pull
```

2. Cherry pick the first parent branch of the this PR on top of the older branch:
```
$ git cherry-pick -m1 12c9c626dc30a8d0f1c2305c3fdf8cc3e9acbcde
```

3. You will likely have some merge/cherry-pick conflict here, fix them and commit:

```
$ git commit -am 'Backport PR #33847: CI: Skip permissions test when running as sudo'
```

4. Push to a named branch :

```
git push YOURFORK 1.0.x:auto-backport-of-pr-33847-on-1.0.x
```

5. Create a PR against branch 1.0.x, I would have named this PR:

> "Backport PR #33847 on branch 1.0.x"

And apply the correct labels and milestones.

Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon!

If these instruction are inaccurate, feel free to [suggest an improvement](https://github.com/MeeseeksBox/MeeseeksDev).
                
xref https://github.com/pandas-dev/pandas/issues/33300#issuecomment-623602846