croconut / godot-tester

A Github Action to handle testing Godot applications with GUT
MIT License
36 stars 14 forks source link

Unable to Download Godot #43

Open XanGrab opened 5 months ago

XanGrab commented 5 months ago

Noticed the following issue two days ago trying to use the actions as normal with a pull request:

2m 17s
Run croconut/godot-tester@v5
  with:
    version: 3.5
    release_type: stable
    is-mono: false
    path: .
    import-time: 100
    test-timeout: 60
    minimum-pass: 0.99
    test-dir: res://Test
    assert-check: true
    max-fails: 1
    result-output-file: test_results.xml
    direct-scene: false
    config-file: res://.gutconfig.json
/usr/bin/docker run --name dadd4faca31dd2175147bcb2c3c4198046a812_ab61fc --label dadd4f --workdir /github/workspace --rm -e "INPUT_VERSION" -e "INPUT_RELEASE_TYPE" -e "INPUT_IS-MONO" -e "INPUT_PATH" -e "INPUT_IMPORT-TIME" -e "INPUT_TEST-TIMEOUT" -e "INPUT_MINIMUM-PASS" -e "INPUT_TEST-DIR" -e "INPUT_ASSERT-CHECK" -e "INPUT_MAX-FAILS" -e "INPUT_RESULT-OUTPUT-FILE" -e "INPUT_DIRECT-SCENE" -e "INPUT_CONFIG-FILE" -e "INPUT_CUSTOM-GODOT-DL-URL" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_ENVIRONMENT" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e "ACTIONS_RESULTS_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/M2/M2":"/github/workspace" dadd4f:aca31dd2175147bcb2c3c4198046a812  "--godot-version" "3.5" "--release-type" "stable" "--path" "." "--is-mono" "false" "--import-time" "100" "--test-timeout" "60" "--minimum-pass" "0.99" "--test-dir" "res://Test" "--direct-scene" "false" "--assert-check" "true" "--max-fails" "1" "--config-file" "res://.gutconfig.json" "--custom-godot-dl-url" "" "--result-output-file" "test_results.xml"
Downloading Godot from:  https://downloads.tuxfamily.org/godotengine/3.5/Godot_v3.5-stable_linux_headless.64.zip
(node:1) [DEP0147] DeprecationWarning: In future versions of Node.js, fs.rmdir(path, { recursive: true }) will be removed. Use fs.rm(path, { recursive: true }) instead
(Use `node --trace-deprecation ...` to show where the warning was created)
node:internal/validators:372
    throw new ERR_INVALID_CALLBACK(callback);
    ^

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function. Received undefined
    at makeCallback (node:fs:190:3)
    at Object.unlink (node:fs:1751:14)
    at ClientRequest.<anonymous> (/usr/lib/DownloadGodot/helpers/PerformDownload/PerformDownload.js:15:16)
    at ClientRequest.emit (node:events:513:28)
    at TLSSocket.socketErrorListener (node:_http_client:494:9)
    at TLSSocket.emit (node:events:513:28)
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  code: 'ERR_INVALID_CALLBACK'
}

I noticed the endpoint at https://downloads.tuxfamily.org/ seems to be down when I try to access it manually, so I attempted to define a custom custom-godot-dl-url param to download directly from the godot releases page. Unfortunately I still seem to be noticing weird errors when attempting to download Godot:

I have attached my current YAML file as well as the output when testing locally. Is anyone else able to recreate this issue or point out something I might have overlooked?

unit-test.txt output.txt

Thanks in advance!

RGonzalezTech commented 5 months ago

The tux page confirms that they're currently having technical difficulties: https://www.tuxfamily.org/en/news/2024052400

Errors from other downloads

I haven't personally looked into this, but it's possible that the file name pattern from Godot's Github releases doesn't match their uploaded files to Tuxfamily.org, so finding the exe file from the extracted ZIP isn't working. That'd be my guess.

See the code here: https://github.com/croconut/godot-tester/blob/c0b6cffca6fd87793334bdb9cac050228b43eb74/lib/DownloadGodot/DownloadGodot.js#L42-L57

It expects the extracted ZIP file to contain an executable file that ends in: .64 or .x86_64

Potential Solution

We could resolve this by accepting a custom-dl-url-godot-path input which would point to the expected path ( relative to the unzip directory )

RGonzalezTech commented 5 months ago

I started playing around and running the tester on my workstation, but I ran into a roadbump when unzipping the .zip file from the Godot website / github releases

See my fork for the WIP branch: https://github.com/RGonzalezTech/godot-tester/tree/rg/custom-godot-binary

Edit: I haven't tested it in a real github actions environment, but the unit tests are passing 🙃.

You can try updating your github action to use my branch and set the custom inputs. I'll follow up if I end up testing it myself 🤷

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: RGonzalezTech/godot-tester@rg/custom-godot-binary
      with:
        # required
        version: "4.2.2"
        # custom download
        custom-godot-dl-url: "https://github.com/godotengine/godot/releases/download/4.2.2-stable/Godot_v4.2.2-stable_linux.x86_64.zip"
        custom-godot-binary-path: "Godot_v4.2.2-stable_linux.x86_64"
        # etc. etc.

🙏

Edit 2: I ran a super simple test and it worked. 🙏 if it's flexible enough I can make a PR for it to be included into master.