godot-tester icon indicating copy to clipboard operation
godot-tester copied to clipboard

Writing a file fails test

Open Structed opened this issue 4 years ago • 1 comments

Description

I have a test, which writes a file to a path similar to res://tests/temp/config.cfg. I also run


func after_each():
    directory.remove(path)

to remove the file after every single test execution.

This works fine on my local machine. However, it does not with godot-tester.

I assume this is due to file system permissions on the container?

Expected Behaviour

  • File gets written in test
  • Test can assert that the file exists
  • File will be removed after test

Actual Behaviour

Test fails:

[Failed]:  
      at line -1

Repro

Comment out this test and run on GitHub Action

Repro Test: https://github.com/Structed/godot-playfab/blob/db0ca9f1e1ee170080394fa8ed21bd7a22778a34/addons/godot-playfab/test/unit/PlayFabClientConfig/test_PlayFabClientConfigLoader.gd#L13

Structed avatar Apr 16 '22 21:04 Structed

Will add as a test goal. We should be able to enable file writing from tests as this action has no secrets that can be exploited.

That said, solution may requires tests to be run with a specific file path

croconut avatar Jun 24 '23 22:06 croconut