google / clasp

🔗 Command Line Apps Script Projects
https://developers.google.com/apps-script/guides/clasp
Apache License 2.0
4.52k stars 422 forks source link

Tests are broken (access denied to "communal testing project") #987

Open HoldYourWaffle opened 9 months ago

HoldYourWaffle commented 9 months ago

Expected Behavior

Running the tests on the master branch according to the instructions should pass with flying colors.

Actual Behavior

A bunch of tests fail :(

So far I have identified 4 separate issues:

  1. The documentation never mentions needing to run npm link after uninstalling the local version of clasp (d9bb573419fd9c4a8a001cebae8c7e986a915dd8)
  2. Forgetting to define the SCRIPT_ID and/or PROJECT_ID environment variables fails silently (29b925e5d97a0a426d254be7ac0a91344d05c17a)
  3. The HOME environment variable does not exist on Windows, resulting in an incorrect CLASP_PATHS.rcGlobal (0c3081c1796e9b7507191a6248e2750c126b7e8e)
  4. The SCRIPT_ID mentioned in the instructions seems to not be publicly accessible, leading to errors like this:
    Could not find script.
    Did you provide the correct scriptId?
    Are you logged in to the correct account with the script?
    Waiting for the debugger to disconnect...

Trying to access this script on the web (unsurprisingly) gives an "access denied".

Steps to Reproduce the Problem

  1. Clone this repository.
  2. Follow the instructions.

Specifications

Fixes

I opened PR #988 with fixes for the first three issues, but the last one is a bit more involved. Regardless of permission issues, I feel like it's a little strange to have one "communal project" to use for tests, sounds like a recipe for trouble. Perhaps it's a good idea to refactor the tests to use the multi-dev workflow described in https://github.com/google/clasp/issues/921#issuecomment-1217019516? I've been meaning to work on improvements for this workflow, this could be a good excuse to finally actually do it.