Closed NickLaMuro closed 4 years ago
Hey @NickLaMuro, if you're mainly trying to run other rake tasks could you do the same thing with the existing TEST_SUITE
env var in the .travis.yml matrix?
Something like
env:
matrix:
- TEST_REPO=manageiq-ui-classic#1234 TEST_SUITE=spec
- TEST_REPO=manageiq-ui-classic#1234 TEST_SUITE=spec:cypress
It failed due to not having nvm
installed but it appears to respect the TEST_SUITE https://travis-ci.com/github/ManageIQ/manageiq-cross_repo-tests/builds/176048283
Should be easy enough to install nvm. I am +1 for the TEST_SUITE idea for now since it already works and requires no code changes.
I can see the benefit of a SCRIPT_CMD for the future, but seems we don't need it, so probably should wait until we do? @agrare Thoughts?
@agrare I don't think your test is valid.
The only reason their was a difference in your failing spec is that it failed when doing before_install.sh
, which does respect the TEST_SUITE
variable in manageiq-ui-classic
to determine what is pre-installed as part of that file:
https://github.com/ManageIQ/manageiq-ui-classic/blob/master/tools/ci/before_install.sh#L2
Which I change in my PR to include spec:cypress
.
The command that would still be run is still going to be bundle exec rake
since that is hard coded in bundle exec manageiq-cross_repo
:
Failed
Passing
Edit: In addition, for your other manageiq-ui-classic matric uses
spec` as the example, which is just the default in the rake file:
That said, what your script did show is that I might need some other changes as well to make this work... 😩
cc @Fryguy
I am confused why nvm
wasn't found in the first place:
https://travis-ci.com/github/ManageIQ/manageiq-cross_repo-tests/jobs/362121956#L100-L101
Actually... it probably is because we are invoking the before_install.rb
with just a vanilla bash
instead of what we do in travis
normally, which is source
it into the existing shell.
Probably can be fixed by changing it to bash -l
... will try that out on my cross-repo
PR.
Edit: Testing some fixes over in my original manageiq-cross_repo-tests
PR.
Yeah we would have to change what we run to bundle exec rake $TEST_SUITE
but this matches what we do in a lot of repos already so that seems useful.
I do agree that something like a TEST_CMD
which defaults to the normal bundle exec rake
could be useful for runing things other than take tasks
other than take tasks
/me giggles to himself
*ahem* excuse me...
So as my "Edit:" in my previous comment shows, I updated my existing manageiq-cross_repo-tests
PR to test the changes I am considering:
https://github.com/ManageIQ/manageiq-cross_repo-tests/pull/150
A few things of note:
TEST_SUITE=spec:cypress
to the ENVmanageiq-cross_repo
to use bash -l
for the before_install.sh
to functionSCRIPT_CMD
But in addition to just changing the command to be bundle exec rake spec:cypress
, I also have to preface it to include bash -l tools/ci/before_script.sh
so the assets are compiled and yarn
is run.
If I didn't include the SCRIPT_CMD
(which I forgot the first time around), the run doesn't get stuck on trying to install nvm
, but still runs bundle exec rake spec
instead of what I wanted:
https://travis-ci.com/github/ManageIQ/manageiq-cross_repo-tests/builds/176085544
This has been fixed (hopefully) in a build that is currently running:
https://travis-ci.com/github/ManageIQ/manageiq-cross_repo-tests/builds/176087199
🤞
That moment when you realize you were using the wrong "repo name syntax" the whole time...
😩
@NickLaMuro Just realized this didn't update the README docs...can you do that when you have a chance?
Allows configuring a custom script to be executed for running the specs.
In this scenario, if this is specific to a particular
TEST_REPO
, then this will only work with said repo and the user will have to configure the cross repo run for that test in particular, and leave the others as the default.This should solve the issues I am having in https://github.com/ManageIQ/manageiq-cross_repo-tests/pull/150 by adding the following to the
.travis.yml
for that one: