[identity] Add template tests to cookbook

Bug #1182562 reported by John Dewey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack + Chef
Fix Released
Wishlist
Brett Campbell
Havana
Fix Released
Wishlist
Brett Campbell

Bug Description

We need chefspec tests to assert the contents of the templates. Ideally we only need to test conditional logic is handled properly in the templates.

Currently they are marked as pending tests.

Jay Pipes (jaypipes)
Changed in openstack-chef:
status: New → Confirmed
importance: Undecided → Medium
tags: added: identity
John Dewey (retr0h)
tags: added: chefspec
John Dewey (retr0h)
Changed in openstack-chef:
importance: Medium → Wishlist
Revision history for this message
Brett Campbell (invsblduck) wrote :

Hi there,

I want to implement all the render_file tests marked pending, but in the case of `default_catalog.templates' there is no conditional logic in the template to actually test (yet there is a 'template contents' test pending there). The keystone.conf template actually has numerous if/else tests, however nothing is marked 'pending' in that context. I'm probably going to write the tests for keystone.conf logic and remove the pending block for default_catalog.templates.

Please let me know if I'm missing something or should do otherwise...

thanks,
duck

Revision history for this message
Brett Campbell (invsblduck) wrote :

( Clarification: "numerous if/else tests" == conditional logic in the ERB template )

summary: - Add template tests to openstack-identity cookbook
+ [identity] Add template tests to cookbook
Changed in openstack-chef:
assignee: nobody → Brett Campbell (invsblduck)
Revision history for this message
Brett Campbell (invsblduck) wrote :

Patch is up for review here https://review.openstack.org/#/c/71057

Changed in openstack-chef:
status: Confirmed → In Progress
Revision history for this message
Ionuț Arțăriși (mapleoin) wrote :

FWIW I think adding tests for the default attributes is also worthwhile. i.e. not just for conditional logic.

Revision history for this message
Brett Campbell (invsblduck) wrote :

I think it may be worth a new blueprint (to test default values in all cookbook templates)? Since I'm relatively new to the code base (and testing), I'm not sure what the other cookbook specs look like yet. I know you mentioned "testing defaults" is something we're already doing.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cookbook-openstack-identity (master)

Reviewed: https://review.openstack.org/71057
Committed: https://git.openstack.org/cgit/stackforge/cookbook-openstack-identity/commit/?id=a219a7ef52f3c554ecd5943e8015ddc4b7c8dc35
Submitter: Jenkins
Branch: master

commit a219a7ef52f3c554ecd5943e8015ddc4b7c8dc35
Author: invsblduck <email address hidden>
Date: Mon Feb 3 23:21:07 2014 -0800

    refactor keystone.conf template specs

    add tests for every tunable. organize code layout to reflect actual
    template layout (group tests, in order). also 3x performance gain by
    collapsing 50+ chef converges into one. remove 'pending' tests in
    other platforms since there are no platform-specific tunables.

    Change-Id: Ib0dc3728a5b0c81bf3b3a36a1a644a7a2fff5910
    Closes-Bug: #1182562

Changed in openstack-chef:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cookbook-openstack-identity (master)

Fix proposed to branch: master
Review: https://review.openstack.org/72932

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.