Skip to content

add integration test p4 protects output as a unit test

Administrator requested to merge perforce-int-tests into main

Created by: mollylogue

I discovered this issue when attempting to run the integration tests, and the sub-repo permissions for the test user consistently came up empty. I discovered that either 1) a regression was introduced when we modified the parsing of the p4 protects output or 2) some permissions on the testing perforce instance were modified and that caused the breakage or 3) a combination of both.

I am a bit confused by this, tbh, and would like some input. In the original version (without the small change I made) we end up with nothing for path_includes and so all the sub-repo perms get deleted and we end up with nothing. I modified that so that we do end up with [**] for path_includes (which is what we'd expect), but then we still end up with an extra ** in the path_excludes, which would lead us to not allow the user to see anything. I'm fairly certain this is because we parse the permissions in order that they are listed by p4 protects, and since the line list group Everyone * -//... comes after the other relevant permissions, it overrides everything else. Am I reading this correctly? I'm not sure if the fix is to modify our parsing or to modify the permissions in p4 on the dogfood perforce server.

Test plan

Unit tests pass

Merge request reports

Loading