After many hours I've found the perfect solution to test this Action: Local "remote" repositories.
I didn't like the tests I've added in #100 and #109 since the beginning: I had to mock all calls to git which lead to many frustrations. It also didn't gave me the confidence that the Action actually did what it should
The docs for shellmock are also sparse and are quite confusing for a newcomer to bash testing like me.
This PR solves all of this problem by simply using a remote repository which is located on the same file system.
A remote repository doesn't have to be hosted on GitHub or another website, but can simply sit on the same file system.
This solves quite a lot of problems:
No authentication to the remote repository required (main point why I had to mock git-previously)
No longer mocking git: As the remote isn't protected by authentication like a public GitHub repository, we can let the action execute all git-commands. As the remote lies on the same file system, the commands execute fast
Tests can run by anyone contributing to the Action, as they all have git installed
I still have some open TODOs where I would like to write better assertions to make sure that git actually did what we want. (And not just assert again what we echo in the script)
This PR will also fix #112 as shellmock is no longer a dependency.
TODOs
[x] Replace remaining TODOs with proper assertions
[x] Update README with instructions on how to run tests
After many hours I've found the perfect solution to test this Action: Local "remote" repositories.
I didn't like the tests I've added in #100 and #109 since the beginning: I had to mock all calls to
git
which lead to many frustrations. It also didn't gave me the confidence that the Action actually did what it should The docs forshellmock
are also sparse and are quite confusing for a newcomer to bash testing like me.This PR solves all of this problem by simply using a remote repository which is located on the same file system. A remote repository doesn't have to be hosted on GitHub or another website, but can simply sit on the same file system.
This solves quite a lot of problems:
git
-previously)git
: As the remote isn't protected by authentication like a public GitHub repository, we can let the action execute allgit
-commands. As the remote lies on the same file system, the commands execute fastI still have some open TODOs where I would like to write better assertions to make sure that
git
actually did what we want. (And not just assert again what we echo in the script)This PR will also fix #112 as
shellmock
is no longer a dependency.TODOs