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

look for tests in /opt/verifier on containers #368

Closed
wants to merge 3 commits into from

Conversation

atheiman
Copy link

@atheiman atheiman commented Jan 5, 2018

This is explained in the kitchen-dokken readme https://github.com/someara/kitchen-dokken#tmpfs-on-tmp

fixes #367

@atheiman
Copy link
Author

atheiman commented Jan 5, 2018

Looks like this is working now and running tests. Here is output from one of the jobs (default-centos-7 ):

Chef Client finished, 50/111 resources updated in 01 minutes 31 seconds
       Finished converging <default-centos-7> (1m43.19s).
-----> Setting up <default-centos-7>...
       Finished setting up <default-centos-7> (0m0.00s).
-----> Verifying <default-centos-7>...
       Creating kitchen sandbox in /home/travis/.dokken/verifier_sandbox/b52efd0ae5-default-centos-7
-----> Installing Busser (busser)
Successfully installed thor-0.19.0
Successfully installed busser-0.7.1
2 gems installed
-----> Installing Busser plugin: busser-serverspec
       Plugin serverspec installed (version 0.5.10)
-----> Running postinstall for serverspec plugin
-----> Running serverspec test suite
-----> Installing Serverspec..
-----> serverspec installed (version 2.41.3)
/opt/chef/embedded/bin/ruby -I/opt/verifier/suites/serverspec -I/opt/verifier/gems/gems/rspec-support-3.7.0/lib:/opt/verifier/gems/gems/rspec-core-3.7.1/lib /opt/chef/embedded/bin/rspec --pattern /opt/verifier/suites/serverspec/\*\*/\*_spec.rb --color --format documentation --default-path /opt/verifier/suites/serverspec
Redis
  behaves like redis on port
WARNING: ignoring the provided expectation message argument ({:if=>true}) since it is not a string or a proc.
    enables the redis service
    is listening on port 6379
File "/etc/redis/savetest.conf"
  should be file
  content
    should match "save a"
  content
    should match "save b"
  content
    should match "save c"
Finished in 0.07877 seconds (files took 0.38577 seconds to load)
6 examples, 0 failures
       Finished verifying <default-centos-7> (0m5.09s).
-----> Kitchen is finished. (2m10.53s)

@atheiman
Copy link
Author

atheiman commented Jan 5, 2018

So since these tests havent been running for a while (I have not looked back to see how long), there are a lot of failures. here is a quick breakdown of the failures by test instance name

  • default-debian-7, default-debian-8, default-ubuntu-1404, default-ubuntu-1604

    1) Command "semanage fcontext --list --noheading | grep -F redis" stdout should match /^\/etc\/redis\(\/\.\*\)\?\s.*:redis_conf_t:/
       Failure/Error: its(:stdout) { should match(pattern) }
         expected "" to match /^\/etc\/redis\(\/\.\*\)\?\s.*:redis_conf_t:/
         Diff:
         @@ -1,2 +1,2 @@
         -/^\/etc\/redis\(\/\.\*\)\?\s.*:redis_conf_t:/
         +""
         /bin/sh -c semanage\ fcontext\ --list\ --noheading\ \|\ grep\ -F\ redis
         
       # /opt/verifier/suites/serverspec/redisio_spec.rb:25:in `block (3 levels) in <top (required)>'
    
    2) Command "semanage fcontext --list --noheading | grep -F redis" stdout should match /^\/var\/lib\/redis\(\/\.\*\)\?\s.*:redis_var_lib_t:/
       Failure/Error: its(:stdout) { should match(pattern) }
         expected "" to match /^\/var\/lib\/redis\(\/\.\*\)\?\s.*:redis_var_lib_t:/
         Diff:
         @@ -1,2 +1,2 @@
         -/^\/var\/lib\/redis\(\/\.\*\)\?\s.*:redis_var_lib_t:/
         +""
         
       # /opt/verifier/suites/serverspec/redisio_spec.rb:25:in `block (3 levels) in <top (required)>'
    
    3) Command "semanage fcontext --list --noheading | grep -F redis" stdout should match /^\/var\/run\/redis\(\/\.\*\)\?\s.*:redis_var_run_t:/
       Failure/Error: its(:stdout) { should match(pattern) }
         expected "" to match /^\/var\/run\/redis\(\/\.\*\)\?\s.*:redis_var_run_t:/
         Diff:
         @@ -1,2 +1,2 @@
         -/^\/var\/run\/redis\(\/\.\*\)\?\s.*:redis_var_run_t:/
         +""
         
       # /opt/verifier/suites/serverspec/redisio_spec.rb:25:in `block (3 levels) in <top (required)>'
    
    4) Command "semanage fcontext --list --noheading | grep -F redis" stdout should match /^\/var\/log\/redis\(\/\.\*\)\?\s.*:redis_log_t:/
       Failure/Error: its(:stdout) { should match(pattern) }
         expected "" to match /^\/var\/log\/redis\(\/\.\*\)\?\s.*:redis_log_t:/
         Diff:
         @@ -1,2 +1,2 @@
         -/^\/var\/log\/redis\(\/\.\*\)\?\s.*:redis_log_t:/
         +""
         
       # /opt/verifier/suites/serverspec/redisio_spec.rb:25:in `block (3 levels) in <top (required)>'
    
  • redis-package-ubuntu-1604

    1) Redis behaves like redis on port is listening on port 6379
       Failure/Error: DEFAULT_FAILURE_NOTIFIER = lambda { |failure, _opts| raise failure }
         expected Port "6379" to be listening
         /bin/sh -c ss\ -tunl\ \|\ grep\ --\ :6379\\\ 
         
       Shared Example Group: "redis on port" called from /opt/verifier/suites/serverspec/redisio_spec.rb:4
       # /opt/verifier/suites/serverspec/redisio_examples.rb:22:in `block (2 levels) in <top (required)>'
    
  • sentinel-fedora-latest

    -----> Starting Kitchen (v1.19.2)
    -----> Creating <sentinel-fedora-latest>...
           Creating container chef-12.19.36
           Creating kitchen sandbox at /home/travis/.dokken/kitchen_sandbox/b52efd0ae5-sentinel-fedora-latest
           Creating verifier sandbox at /home/travis/.dokken/verifier_sandbox/b52efd0ae5-sentinel-fedora-latest
           Building work image..
    >>>>>> ------Exception-------
    >>>>>> Class: Kitchen::ActionFailed
    >>>>>> Message: 1 actions failed.
    >>>>>>     Failed to complete #create action: [work_image build failed: The command '/bin/sh -c dnf -y install yum which systemd-sysv initscripts wget net-tools sudo' returned a non-zero code: 1. The common scenerios are incorrect intermediateinstructions such as not including `-y` on an `apt-get` or similar. The other common scenerio is a transient error such as an unresponsive mirror.] on sentinel-fedora-latest
    >>>>>> ----------------------
    
  • multisentinel-centos-6, multisentinel-centos-7, multisentinel-debian-7, multisentinel-debian-8, multisentinel-ubuntu-1404, multisentinel-ubuntu-1604

    rspec '/opt/verifier/suites/serverspec/multiple_sentinels_spec.rb[2:2:1]' # File "/etc/redis/sentinel_cluster.conf" content should match /sentinel down-after-milliseconds master6379 30000/
    rspec '/opt/verifier/suites/serverspec/multiple_sentinels_spec.rb[2:3:1]' # File "/etc/redis/sentinel_cluster.conf" content should match /sentinel parallel-syncs master6379 1/
    rspec '/opt/verifier/suites/serverspec/multiple_sentinels_spec.rb[2:4:1]' # File "/etc/redis/sentinel_cluster.conf" content should match /sentinel failover-timeout master6379 900000/
    rspec '/opt/verifier/suites/serverspec/multiple_sentinels_spec.rb[2:6:1]' # File "/etc/redis/sentinel_cluster.conf" content should match /sentinel down-after-milliseconds master6380 30000/
    rspec '/opt/verifier/suites/serverspec/multiple_sentinels_spec.rb[2:7:1]' # File "/etc/redis/sentinel_cluster.conf" content should match /sentinel parallel-syncs master6380 1/
    rspec '/opt/verifier/suites/serverspec/multiple_sentinels_spec.rb[2:8:1]' # File "/etc/redis/sentinel_cluster.conf" content should match /sentinel failover-timeout master6380 900000/
    rspec '/opt/verifier/suites/serverspec/multiple_sentinels_spec.rb[4:25:1]' # Command "/usr/local/bin/redis-cli --raw -p 26379 SENTINEL MASTER master6379" stdout should match /900000/
    rspec '/opt/verifier/suites/serverspec/multiple_sentinels_spec.rb[5:25:1]' # Command "/usr/local/bin/redis-cli --raw -p 26379 SENTINEL MASTER master6380" stdout should match /900000/
    
  • multisentinel-fedora-latest

    rspec /opt/verifier/suites/serverspec/multiple_sentinels_spec.rb[1:1:2:1:1] # Redis-Sentinel behaves like sentinel on port Command "ps aux | grep -v grep | grep 'redis-server' | grep '*:26379'" exit_status should eq 0
    rspec /opt/verifier/suites/serverspec/multiple_sentinels_spec.rb[2:2:1] # File "/etc/redis/sentinel_cluster.conf" content should match /sentinel down-after-milliseconds master6379 30000/
    rspec /opt/verifier/suites/serverspec/multiple_sentinels_spec.rb[2:3:1] # File "/etc/redis/sentinel_cluster.conf" content should match /sentinel parallel-syncs master6379 1/
    rspec /opt/verifier/suites/serverspec/multiple_sentinels_spec.rb[2:4:1] # File "/etc/redis/sentinel_cluster.conf" content should match /sentinel failover-timeout master6379 900000/
    rspec /opt/verifier/suites/serverspec/multiple_sentinels_spec.rb[2:6:1] # File "/etc/redis/sentinel_cluster.conf" content should match /sentinel down-after-milliseconds master6380 30000/
    rspec /opt/verifier/suites/serverspec/multiple_sentinels_spec.rb[2:7:1] # File "/etc/redis/sentinel_cluster.conf" content should match /sentinel parallel-syncs master6380 1/
    rspec /opt/verifier/suites/serverspec/multiple_sentinels_spec.rb[2:8:1] # File "/etc/redis/sentinel_cluster.conf" content should match /sentinel failover-timeout master6380 900000/
    rspec /opt/verifier/suites/serverspec/multiple_sentinels_spec.rb[3:25:1] # Command "/usr/local/bin/redis-cli --raw -p 26379 SENTINEL MASTER master6379" stdout should match /900000/
    rspec /opt/verifier/suites/serverspec/multiple_sentinels_spec.rb[4:25:1] # Command "/usr/local/bin/redis-cli --raw -p 26379 SENTINEL MASTER master6380" stdout should match /900000/
    

@majormoses
Copy link
Contributor

Thanks for taking a look and fixing some of the issues. For some reason travis is not triggering a rebuild when I issue it in console. I pushed an empty commit to try to have it re-run it. I am pretty new to this cookbook so it might take me a bit to fix the tests but I'd like to postpone merging any functional changes until tests pass again. If you want to pack out everything but the dokken config I am 👍 to merge this and work on fixing tests to get this cookbook in a better place.

@atheiman
Copy link
Author

atheiman commented Mar 30, 2018

im not sure what you want, the only changes in here are to fix most of the travis / docker tests. myabe youre referring to the rubocop.yml, but i think that thing is getting a little silly when it has exceptions for so many rubocop style rules.

edit: im fine with you pushing commits up to this, I dont work much with this cookbook anymore so I dont know how actively ill follow up on these prs

@majormoses
Copy link
Contributor

I was specifically referring to the change in how we reference data bags. While I realize that is preferable to use data_bag_item over Chef::EncryptedDataBagItem.load I do consider that a functional change.

edit: im fine with you pushing commits up to this, I dont work much with this cookbook anymore so I dont know how actively ill follow up on these prs

Sorry to hear that I will try to do what I can with the limited time I have.

@tas50
Copy link
Contributor

tas50 commented Nov 27, 2018

@atheiman we've reworked the whole testing of this cookbook and brought in a few of your changes. Any change you can bring in just the verifier bit so we can get this merged in.

@xorima
Copy link
Contributor

xorima commented Aug 8, 2019

Hi
We have just adopted this cookbook and are aiming to rebaseline it, as part of this we are closing down all prs older than 1 year.
If you still need this change please open a new PR and we will assess this as part of our rebaseline
Thanks for your understanding
Sous-Chefs

@xorima xorima closed this Aug 8, 2019
@lock
Copy link

lock bot commented Sep 7, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tests not running with kitchen-dokken (including in Travis), looking in /tmp rather than /opt
4 participants