rest-nvim / rest.nvim

A fast Neovim http client written in Lua
GNU General Public License v3.0
1.61k stars 142 forks source link

test: overhaul tests to support `make test` & minimal init #310

Closed PriceHiller closed 8 months ago

PriceHiller commented 8 months ago

Copied from the body of the commit message:

This now allows tests to be ran via make test.

Currently the tests defined in main_spec.lua are invalid, as the run_file method appears to have been removed at some point.

At the bare minimum though, this commit gives rest.nvim a decent framework to work off of for running tests in the future when written.

As noted in the body of the commit -- the tests currently written don't work due to a removal of a function in the past.

Hopefully this eases writing tests down the road if someone decides to write them.

The minimal init tests do expect whoever is running them to have luarocks installed -- it directly calls into the luarocks cli as an fyi.

If you don't care about the tests/don't want the maintenance burden on this, feel free to close this out 🙂.

NTBBloodbath commented 8 months ago

As noted in the body of the commit -- the tests currently written don't work due to a removal of a function in the past.

Hopefully this eases writing tests down the road if someone decides to write them.

Oh yeah, I was planning on adjusting them again later and this will really make the process easier. Before there was a workflow with Nix, but I know absolutely nothing about Nix and there was no one to maintain the flake so I decided to remove it, and when the tests are functional again I will make a testing CI using the Makefile :)

The minimal init tests do expect whoever is running them to have luarocks installed -- it directly calls into the luarocks cli as an fyi.

That's fine with me, could we mention it somewhere in the readme (maybe under the Contributing section)?

If you don't care about the tests/don't want the maintenance burden on this, feel free to close this out 🙂.

It's fine, tests are very important to me. I wanted to give it its update due to the tests but I did not want to continue delaying the release of v2 (it was already almost 2 months longer than I planned 😅)

PriceHiller commented 8 months ago

Oh yeah, I was planning on adjusting them again later and this will really make the process easier. Before there was a workflow with Nix, but I know absolutely nothing about Nix and there was no one to maintain the flake so I decided to remove it, and when the tests are functional again I will make a testing CI using the Makefile :)

Nix is damn cool, I use it a lot here locally. Unfortunately, there's not a learning curve to it, there's a learning abyss -- not exactly user friendly lol. Don't blame you at all for yanking it.

That's fine with me, could we mention it somewhere in the readme (maybe under the Contributing section)?

Updated the README to mention this, let me know if you want me to change the wording.

NTBBloodbath commented 8 months ago

Oh yeah, I was planning on adjusting them again later and this will really make the process easier. Before there was a workflow with Nix, but I know absolutely nothing about Nix and there was no one to maintain the flake so I decided to remove it, and when the tests are functional again I will make a testing CI using the Makefile :)

Nix is damn cool, I use it a lot here locally. Unfortunately, there's not a learning curve to it, there's a learning abyss -- not exactly user friendly lol. Don't blame you at all for yanking it.

Yeah, hopefully one day the use of Nix will be able to resume as it is really powerful :p

That's fine with me, could we mention it somewhere in the readme (maybe under the Contributing section)?

Updated the README to mention this, let me know if you want me to change the wording.

It looks good to me, thank you! 🙂