Skip to content

perforce: create example depot for use for use in permissions testing

Administrator requested to merge example-depot into main

Created by: ggilmore

This PR adds two things:

example depot for Perforce permissions testing

This is an example Perforce depot that has a file/folder layout similar to the one that the customer (linked in this Slack thread) uses in their test suite.

  • The exact file paths mentioned in the customer's original test suite were substituted with similar-enough ones. I chose to use human-friendly file / folder names instead of the machine-obfuscated ones contributed in https://github.com/sourcegraph/sourcegraph/pull/39063. Since we're going to be doing manual testing at first, I thought it would be a lot easier for people to reason about files/folders that looked like common words instead of hashes.

  • Each folder has a file named path.txt in it. The tests in the original suite didn't enumerate the full file tree: there are folders that are alluded to in tests with unknown file contents. You can't create an empty folder in Perforce, so I added a stub path.txt file at every level to work around that.

./p4-upload.sh

This is a simple bash script that uploads the above depot to the Perforce server specified in the supplied P4PORT and P4USER environment variables (default: [email protected]) . The script does this idempotently - on each run it'll delete and re-submit the depot from scratch. This ensures that the depot's state is exactly what we expect for each round of manual testing. Eventually, this script (or the logic in it) should be able to be used in an automated integration test setup as well.

Test plan

Tested by manually running this script against perforce.sgdev.org.

Merge request reports

Loading