Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load/run rb file for smoke test #81

Open
darrenhaken opened this issue Aug 4, 2016 · 6 comments
Open

Load/run rb file for smoke test #81

darrenhaken opened this issue Aug 4, 2016 · 6 comments

Comments

@darrenhaken
Copy link

Is it possible to load an rb file for the smoke test rather than being inline?
If so can you share an example?

@wpc
Copy link
Contributor

wpc commented Aug 4, 2016

It's ruby code so you can do anything you want.

Execute a rake task:

    smoke_test: |
      raise "smoke failed" unless system("rake test:smoke SMOKE_TEST_HOSTNAME=#{host_name}")

Run a python verify script:

    smoke_test: |
      raise "smoke failed" unless system("python verify.py #{host_name}")

load a ruby script

    smoke_test: |
        load "smoke_test.rb"

@darrenhaken
Copy link
Author

I tried below but it didn't work as it said the rb file didn't exist. Now you've confirmed it should work I'll look into it again

smoke_test: |
        load "smoke_test.rb"

@darrenhaken
Copy link
Author

darrenhaken commented Aug 4, 2016

@wpc do you know if eb_deployer defines an environment variable for the environment set?

I ran ENVIRONMENT=test eb_deploy -c eb_deployer.yml -p test.zip -e test and ENV['ENVIRONMENT'] returns "project-name-test"

@wpc
Copy link
Contributor

wpc commented Aug 5, 2016

That's weird, eb_deployer do not set any environment variables. Use export to check predefined environment variable in your terminal, and check your inline code in the config file as well.

@darrenhaken
Copy link
Author

@wpc I'll look if it's being set on the CI server.

In the smoke test examples it defines a variable host_name but when I used it in smoke_test.rb it says its undefined. How does this get set?

@wpc
Copy link
Contributor

wpc commented Aug 5, 2016

i guess you can do

smoke_test: |
        SMOKE_TEST_HOST_NAME="#{host_name}"
        load "smoke_test.rb"

then reference the host name by constant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants