Skip to content

Commit

Permalink
scalar: add a test toggle to skip accessing the vsts/info endpoint
Browse files Browse the repository at this point in the history
In Scalar's functional tests, we do not do anything with authentication.
Therefore, we do want to avoid accessing the `vsts/info` endpoint
because it requires authentication even on otherwise public
repositories.

Let's introduce the environment variable `SCALAR_TEST_SKIP_VSTS_INFO`
which can be set to `true` to simply skip that step (and force the
`url_*` style repository IDs instead of `id_*` whenever possible).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Aug 16, 2023
1 parent db4c4b9 commit 55bd839
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scalar.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,8 @@ static char *get_cache_key(const char *url)
* The GVFS protocol is only supported via https://; For testing, we
* also allow http://.
*/
if (can_url_support_gvfs(url)) {
if (!git_env_bool("SCALAR_TEST_SKIP_VSTS_INFO", 0) &&
can_url_support_gvfs(url)) {
cp.git_cmd = 1;
strvec_pushl(&cp.args, "gvfs-helper", "--remote", url,
"endpoint", "vsts/info", NULL);
Expand Down

0 comments on commit 55bd839

Please sign in to comment.