Open leonstafford opened 3 years ago
OK, re the ordering of the LOKL_RELEASE_VERSION, I think I can see what's happening.
You'll find in other tests, that I'm mocking/stubbing/overriding (whatever the term is!) that env var where required, ie:
It "sets docker image tag to php8-LOKL_RELEASE_VERSION when 8 chosen"
LOKL_RELEASE_VERSION=0.0.1
Data "8"
When call create_site_choose_php_version
The variable LOKL_DOCKER_TAG should equal 'php8-0.0.1'
The output should include \
'create_wordpress_docker_container() called'
The status should be success
End
Note: the most confusing part of ShellSpec is the difference between When run
and When call
- basically, different shell scopes and ways you'll override built-ins. I've got some tests using one or the other, and if in doubt, try the other one!
So, my hope, is that you were trying to write a test which called one of those set_docker_tag()
or such functions before it was defined for testing. I just span up another instance manually and I'm pretty sure end to end test of running a site noninteractively passed before that pre-release, so I think it's just an issue in needing to provide that variable to shellspec test.
Have to run out for a bit, let me know any other info
Originally I ran ./test.sh from the lokl root directory. It "passed" when I re-ordered the ENV Vars of lokl-cli and manually copied cli.sh to lokl. I think you are correct in stating LOKL_RELEASE_VERSION just needs added to shellspec.
as reported by Jonathan here