Closed kanekoh closed 7 years ago
We have created an issue in Pivotal Tracker to manage this:
https://www.pivotaltracker.com/story/show/149792900
The labels on this github issue will be updated when the story is started.
I believe this is due to how our Concourse CI/CD system runs these tests. @dgodd may be able to provide more info.
We have just changed our integration test framework for the staticfile buildpack to make it easier and faster to run. The new test suite is on the develop branch. It would be interesting to know if you have any problems with it @kanekoh ?
I tried to execute the integration tests on the develop branch in my environment and got the error as follows:
~ Failure in Spec Setup (BeforeEach) [61.845 seconds]
deploy a staticfile app
/home/cloud-user/kaneko_work/buildpack-tests/staticfile-buildpack/src/staticfile/integration/deploy_reverse_proxy_app_test.go:29
proxies [BeforeEach]
/home/cloud-user/kaneko_work/buildpack-tests/staticfile-buildpack/src/staticfile/integration/deploy_reverse_proxy_app_test.go:28
Timed out after 10.193s.
Error: Unexpected non-nil/non-zero extra argument at index 1:
<*errors.errorString>: &errors.errorString{s:"Expected one app, found 0"}
/home/cloud-user/kaneko_work/buildpack-tests/staticfile-buildpack/src/staticfile/integr
Am I missing somthing?
BTW, I'd like to specify the flag like 'version', 'cached' when exectuing integration tests.
If you check scripts/integration it should show you how to specify cached true/false. There is also a version flag which stops the tests from creating and uploading a buildpack and tests against the existing one
Was it a single test that failed? Or all of them?
All of them failed with the above error. The application looks running on CF v254 + Diego v1.10.1.
name: cutlass-fixture-copy429088257-jjpjzpfrfegmotafeths
requested state: started
instances: 1/1
usage: 128M x 1 instances
routes: cutlass-fixture-copy429088257-jjpjzpfrfegmotafeths.jp-west-1.cf-app.net
last uploaded: Wed 02 Aug 23:30:15 UTC 2017
stack: cflinuxfs2
buildpack: staticfile 1.4.11
start command: $HOME/boot.sh
state since cpu memory disk details
#0 running 2017-08-02T23:30:39Z 0.0% 2.4M of 128M 7.2M of 128M
Deleting app cutlass-fixture-copy429088257-jjpjzpfrfegmotafeths in org pivotal / space integration-staticfile-1501485255 as release-802efa6b-532e-48ec-9c0c-b956d01b6e79
OK
~ Failure in Spec Setup (JustBeforeEach) [36.418 seconds]
deploy a an app with dot files
/home/cloud-user/kaneko_work/buildpack-tests/staticfile-buildpack/src/staticfile/integration/deploy_app_with_dotfiles_test.go:89
host_dot_files: true is present in Staticfile [JustBeforeEach]
/home/cloud-user/kaneko_work/buildpack-tests/staticfile-buildpack/src/staticfile/integration/deploy_app_with_dotfiles_test.go:65
the app uses the default root location
/home/cloud-user/kaneko_work/buildpack-tests/staticfile-buildpack/src/staticfile/integration/deploy_app_with_dotfiles_test.go:54
hosts the dotfiles
/home/cloud-user/kaneko_work/buildpack-tests/staticfile-buildpack/src/staticfile/integration/deploy_app_with_dotfiles_test.go:53
Timed out after 10.087s.
Error: Unexpected non-nil/non-zero extra argument at index 1:
<*errors.errorString>: &errors.errorString{s:"Expected one app, found 0"}
/home/cloud-user/kaneko_work/buildpack-tests/staticfile-buildpack/src/staticfile/integration/integration_suite_test.go:40
------------------------------
That looks to me like it failed waiting for the app to push. Could you please try increasing the timeout on the following line
and tell me if it works. If it does, I will increase the timeout (or if you would like to send a PR)
On Thu, Aug 3, 2017 at 7:27 PM Hiroyuki Kaneko notifications@github.com wrote:
All of them failed with the above error. The application looks running on CF v254 + Diego v1.10.1.
name: cutlass-fixture-copy429088257-jjpjzpfrfegmotafeths requested state: started instances: 1/1 usage: 128M x 1 instances routes: cutlass-fixture-copy429088257-jjpjzpfrfegmotafeths.jp-west-1.cf-app.net last uploaded: Wed 02 Aug 23:30:15 UTC 2017 stack: cflinuxfs2 buildpack: staticfile 1.4.11 start command: $HOME/boot.sh
state since cpu memory disk details
0 running 2017-08-02T23:30:39Z 0.0% 2.4M of 128M 7.2M of 128M
Deleting app cutlass-fixture-copy429088257-jjpjzpfrfegmotafeths in org pivotal / space integration-staticfile-1501485255 as release-802efa6b-532e-48ec-9c0c-b956d01b6e79 OK
~ Failure in Spec Setup (JustBeforeEach) [36.418 seconds] deploy a an app with dot files /home/cloud-user/kaneko_work/buildpack-tests/staticfile-buildpack/src/staticfile/integration/deploy_app_with_dotfiles_test.go:89 host_dot_files: true is present in Staticfile [JustBeforeEach] /home/cloud-user/kaneko_work/buildpack-tests/staticfile-buildpack/src/staticfile/integration/deploy_app_with_dotfiles_test.go:65 the app uses the default root location /home/cloud-user/kaneko_work/buildpack-tests/staticfile-buildpack/src/staticfile/integration/deploy_app_with_dotfiles_test.go:54 hosts the dotfiles /home/cloud-user/kaneko_work/buildpack-tests/staticfile-buildpack/src/staticfile/integration/deploy_app_with_dotfiles_test.go:53
Timed out after 10.087s. Error: Unexpected non-nil/non-zero extra argument at index 1: <*errors.errorString>: &errors.errorString{s:"Expected one app, found 0"} /home/cloud-user/kaneko_work/buildpack-tests/staticfile-buildpack/src/staticfile/integration/integration_suite_test.go:40
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cloudfoundry/staticfile-buildpack/issues/110#issuecomment-320116391, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHtTUd_3m4HDrz-hgCWx7lVo1DTALi4ks5sUldHgaJpZM4On8XG .
@dgodd, the cause of issue is that I specified the CF_HOME environment variable while executing the tests however still it has failure cases so I need time to investigate them.
@kanekoh I don't understand how setting CF_HOME on your machine should cause problems. Could you please explain so I can at the least help others in the future.
Did you try increasing the timeout? Did it help?
@dgodd , i tried increasing the timeout but it didn't help for me. The cause is libbuildpack get a space guid from .cf/config.json file with HOME environment. I specified CF_HOME so my .cf/config.json file was at $CF_HOME/.cf/config.json but not at $HOME/.cf/config.json.
@dgodd I definitely agree that we shouldn't be parsing the CLI config here: https://github.com/cloudfoundry/libbuildpack/blob/master/cutlass/cf.go#L157
@slevine I'm open to alternatives. Unfortunately as far as I am aware, it isn't possible to get it from the cli.
@dgodd , How about using the cf command with --guid option as follows?
I've asked cli PM the best way to get space guid from cf cli command. .cf/config.json
is internal file for cf cli so it's not good way to parse that file.
And we can get targeted space name with cf target
command without any arguments.
$ cf space pivotal --guid
a95adf85-e3f3-4e8b-9371-40dd7c828593
@sclevine @kanekoh I was about to try this. Unfortunately cf space pivotal --guid
means I need to know the currrent space and cf target
doesn't accept guid
. Unless anyone has other suggestions, I am going to use $CF_HOME or ~/.cf/
We should not rely on internal implementation details of the cf CLI to obtain the current space GUID.
The current space can be determined with the cf target
command. To get the current space GUID (in bash), one could do:
cf space "$(cf target|awk '/^space:/ { sub("space:[ \t]*", "", $0); print }')" --guid
@sclevine We have done such things in the past, I have found that the textual output changes more frequently than the config file on disk. I personally feel that the disk json/yaml representation is a a safer detail than parsing human readable text. (My preferred option of course would be that the cli output machine output, eg. json or the --guid flag)
Do we control the name of the space? Can the space name be provided by the user running the text somehow?
I would strongly prefer to avoid relying on implementation details of the CLI.
@sclevine We could force users to specify the space when they run ginkgo, but I would rather not, it makes things much more annoying
Closing this as the tests now respect CF_HOME
.
What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running
cf curl /v2/info && cf version
?I use CF v254 + Diego v1.10.1 and cli version 6.26
The result of
cf curl /v2/info
( made URL dummy...)The result of cf version
What version of the buildpack you are using?
staticfile v1.4.11
If you were attempting to accomplish a task, what was it you were attempting to do?
Execute integration tests for buildpack as follows
BUNDLE_GEMFILE=cf.Gemfile bundle exec buildpack-build --delete-space-on-exit --no-upload --host=bosh-lite.com
What did you expect to happen?
All tests pass.
What was the actual behavior?
I got an error as follows:
The cause is I didn't upload the buildpack name with 'staticfile-test-buildpack'. Is there any reason to specify 'staticfile-test-buildpack' as buildpack name?
Please confirm where necessary: