Kampfkarren / Roblox

Scripts and stuff I wrote for Roblox. Documentation is little to none as these are just stuff I took from my game that I thought I could share.
https://kampfkarren.github.io/Roblox/
Other
285 stars 78 forks source link

Implemented optional data validation #118

Open Masken8 opened 3 years ago

Masken8 commented 3 years ago

Implemented #64

Kampfkarren commented 3 years ago

Can you please provide proof that you ran the tests and they pass? I'm trying to get them running on CI.

Kampfkarren commented 3 years ago

Tests run on CI now, merge from latest master.

Kampfkarren commented 3 years ago

Ugh, that specific error is not your fault. I'll look into it.

Kampfkarren commented 3 years ago

I think I don't have the ability to run tests on PRs since you don't have the authentication token, I'm going to clone your branch and test it on there.

Kampfkarren commented 3 years ago

Your tests failed--#121

Please make a good attempt to run the tests locally.

All it should take is:

  1. Download the submodules (for TestEZ and MockDataStoreWrapper)
  2. Build tests.project.json into an rbxlx
  3. Open that rbxlx, and click Run
  4. See the output
Masken8 commented 3 years ago

I'm getting $path referred to a path that could not be turned into an instance by Rojo and then Rojo crashes

Kampfkarren commented 3 years ago

I'd recommend doing a bisect, removing paths from the project.json until it works, so you know which path in specific is causing the issues. Make sure your Rojo is up to date as well.

I know what is causing the test failures, but I want to make sure you know how to run the tests yourself!

Masken8 commented 3 years ago

Attempted to set data store to an invalid value during :Set

Attempted to set data store to an invalid value during :Update

TestService: ServerScriptService.Tests.Tests.DataStore2.spec:96: Expected function to throw an error containing "Attempted to set data store to an invalid value during :Set", but it threw: attempt to call a table value

ServerScriptService.Tests.TestEZ.Expectation:47 function assertLevel
ServerScriptService.Tests.TestEZ.Expectation:305 function throw
ServerScriptService.Tests.TestEZ.Expectation:59
ServerScriptService.Tests.Tests.DataStore2.spec:96
ServerScriptService.Tests.TestEZ.TestRunner:86
ServerScriptService.Tests.TestEZ.TestRunner:84 function runCallback
ServerScriptService.Tests.TestEZ.TestRunner:116 function runNode
ServerScriptService.Tests.TestEZ.TestRunner:153 function runPlanNode
ServerScriptService.Tests.TestEZ.TestRunner:164 function runPlanNode
ServerScriptService.Tests.TestEZ.TestRunner:164 function runPlanNode
ServerScriptService.Tests.TestEZ.TestRunner:164 function runPlanNode
ServerScriptService.Tests.TestEZ.TestRunner:164 function runPlanNode
ServerScriptService.Tests.TestEZ.TestRunner:45 function runPlan
ServerScriptService.Tests.TestEZ.TestBootstrap:127 function run
ServerScriptService.Tests.Tests.TestRunner:5

TestService: ServerScriptService.Tests.Tests.DataStore2.spec:116: Expected function to throw an error containing "Attempted to set data store to an invalid value during :Update", but it threw: attempt to call a nil value

ServerScriptService.Tests.TestEZ.Expectation:47 function assertLevel
ServerScriptService.Tests.TestEZ.Expectation:305 function throw
ServerScriptService.Tests.TestEZ.Expectation:59
ServerScriptService.Tests.Tests.DataStore2.spec:116
ServerScriptService.Tests.TestEZ.TestRunner:86
ServerScriptService.Tests.TestEZ.TestRunner:84 function runCallback
ServerScriptService.Tests.TestEZ.TestRunner:116 function runNode
ServerScriptService.Tests.TestEZ.TestRunner:153 function runPlanNode
ServerScriptService.Tests.TestEZ.TestRunner:164 function runPlanNode
ServerScriptService.Tests.TestEZ.TestRunner:164 function runPlanNode
ServerScriptService.Tests.TestEZ.TestRunner:164 function runPlanNode
ServerScriptService.Tests.TestEZ.TestRunner:164 function runPlanNode
ServerScriptService.Tests.TestEZ.TestRunner:45 function runPlan
ServerScriptService.Tests.TestEZ.TestBootstrap:127 function run
ServerScriptService.Tests.Tests.TestRunner:5

How, I cannot for the life of me figure this out.

Edit: Might have figured it out Edit 2: or not

Kampfkarren commented 3 years ago

Request review from me when you have something that works so I can run it on the CI runner.

Masken8 commented 3 years ago

I have been trying to figure this out for a week now and I'm still none the wiser. I'm still stuck with the cryptic error messages above. The same code without the unit testing works completely fine though so the errors must be caused by TestEZ somehow 🤔