Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
Improve the Jenkinsfile to search for feature files in sub-directories (
Browse files Browse the repository at this point in the history
#7957)

* feat(test): extend Jenkins file to find all features
* fix(test): change version of the API v2 from latest to beta

Resolve MON-4185
  • Loading branch information
vhr authored Oct 11, 2019
1 parent 35e3dd4 commit d3880ef
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ stage('Source') {
reportName: 'Centreon Build Artifacts',
reportTitles: ''
])
featureFiles = sh(script: 'ls -1 centreon-web/features | grep .feature', returnStdout: true).split()
featureFiles = sh(script: 'find centreon-web/features -type f -name "*.feature" -printf "%P\n" | sort', returnStdout: true).split()
}
}

Expand Down
14 changes: 7 additions & 7 deletions features/APIv2/Monitoring/HostApi.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Feature: Check health of the Monitoring - Host API
And Exchange user identity token for admin user

Scenario: List all hosts without services
When I make a GET request to "/api/latest/monitoring/hosts?show_service=false"
When I make a GET request to "/api/beta/monitoring/hosts?show_service=false"
Then the response code should be 200
And the property "meta" has value
"""
Expand All @@ -19,7 +19,7 @@ Feature: Check health of the Monitoring - Host API
"""

Scenario: List all hosts with services
When I make a GET request to "/api/latest/monitoring/hosts?show_service=true"
When I make a GET request to "/api/beta/monitoring/hosts?show_service=true"
Then the response code should be 200
And the property "meta" has value
"""
Expand All @@ -31,7 +31,7 @@ Feature: Check health of the Monitoring - Host API
"""

Scenario: List hosts and search by host.name
When I make a GET request to "/api/latest/monitoring/hosts?show_service=false&search={%22host.name%22:%22Centreon-Server%22}"
When I make a GET request to "/api/beta/monitoring/hosts?show_service=false&search={%22host.name%22:%22Centreon-Server%22}"
Then the response code should be 200
And the property "meta" has value
"""
Expand All @@ -41,7 +41,7 @@ Feature: Check health of the Monitoring - Host API
"""
[{"id":14,"poller_id":1,"name":"Centreon-Server","acknowledged":false,"address_ip":"127.0.0.1","alias":"Monitoring Server","check_attempt":1,"checked":true,"display_name":"Centreon-Server","execution_time":0.141715,"icon_image":"","icon_image_alt":"","last_check":"*","last_hard_state_change":null,"last_state_change":null,"last_time_down":null,"last_time_unreachable":null,"last_time_up":"*","last_update":"*","max_check_attempts":5,"output":"OK - 127.0.0.1 rta 0.070ms lost 0%\n","passive_checks":false,"state":0,"state_type":1,"timezone":""}]
"""
When I make a GET request to "/api/latest/monitoring/hosts?show_service=false&search={%22host.name%22:%22MissingOne%22}"
When I make a GET request to "/api/beta/monitoring/hosts?show_service=false&search={%22host.name%22:%22MissingOne%22}"
Then the response code should be 200
And the property "meta" has value
"""
Expand All @@ -53,7 +53,7 @@ Feature: Check health of the Monitoring - Host API
"""

Scenario: List hosts by status (filter on status)
When I make a GET request to "/api/latest/monitoring/hosts?show_service=false&search={%22host.state%22:1}"
When I make a GET request to "/api/beta/monitoring/hosts?show_service=false&search={%22host.state%22:1}"
Then the response code should be 200
And the property "meta" has value
"""
Expand All @@ -63,7 +63,7 @@ Feature: Check health of the Monitoring - Host API
"""
[{"id":14,"poller_id":1,"name":"Centreon-Server","acknowledged":false,"address_ip":"127.0.0.1","alias":"Monitoring Server","check_attempt":1,"checked":true,"display_name":"Centreon-Server","execution_time":0.0,"icon_image":"","icon_image_alt":"","last_check":"*","last_hard_state_change":"*","last_state_change":"*","last_time_down":"*","last_time_unreachable":null,"last_time_up":"*","last_update":"*","max_check_attempts":5,"output":"OK - 127.0.0.1 rta 0.074ms lost 0%\n","passive_checks":false,"state":1,"state_type":0,"timezone":""}]
"""
When I make a GET request to "/api/latest/monitoring/hosts?show_service=false&search={%22host.state%22:0}"
When I make a GET request to "/api/beta/monitoring/hosts?show_service=false&search={%22host.state%22:0}"
Then the response code should be 200
And the property "meta" has value
"""
Expand All @@ -75,7 +75,7 @@ Feature: Check health of the Monitoring - Host API
"""

Scenario: List hosts by hostgroup
When I make a GET request to "/api/latest/monitoring/hostgroups"
When I make a GET request to "/api/beta/monitoring/hostgroups"
Then the response code should be 200
And the property "meta" has value
"""
Expand Down
14 changes: 7 additions & 7 deletions features/APIv2/Monitoring/ServiceApi.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Feature: Check health of the Monitoring - Service API
And Exchange user identity token for admin user

Scenario: List services
When I make a GET request to "/api/latest/monitoring/services"
When I make a GET request to "/api/beta/monitoring/services"
Then the response code should be 200
And the property "meta" has value
"""
Expand All @@ -19,7 +19,7 @@ Feature: Check health of the Monitoring - Service API
"""

Scenario: List services and search by service.name
When I make a GET request to "/api/latest/monitoring/services?search={%22service.display_name%22:%22Ping%22}"
When I make a GET request to "/api/beta/monitoring/services?search={%22service.display_name%22:%22Ping%22}"
Then the response code should be 200
And the property "meta" has value
"""
Expand All @@ -31,7 +31,7 @@ Feature: Check health of the Monitoring - Service API
"""

Scenario: List services by status
When I make a GET request to "/api/latest/monitoring/services?search={%22service.state%22:%221%22}"
When I make a GET request to "/api/beta/monitoring/services?search={%22service.state%22:%221%22}"
Then the response code should be 200
And the property "meta" has value
"""
Expand All @@ -41,7 +41,7 @@ Feature: Check health of the Monitoring - Service API
"""
[]
"""
When I make a GET request to "/api/latest/monitoring/services?search={%22service.state%22:%220%22}"
When I make a GET request to "/api/beta/monitoring/services?search={%22service.state%22:%220%22}"
Then the response code should be 200
And the property "meta" has value
"""
Expand All @@ -53,7 +53,7 @@ Feature: Check health of the Monitoring - Service API
"""

Scenario: List services by servicegroup
When I make a GET request to "/api/latest/monitoring/servicegroups"
When I make a GET request to "/api/beta/monitoring/servicegroups"
Then the response code should be 200
And the property "meta" has value
"""
Expand All @@ -65,7 +65,7 @@ Feature: Check health of the Monitoring - Service API
"""

Scenario: List services of a host
When I make a GET request to "/api/latest/monitoring/services?search={%22host.name%22:%22Centreon-Server%22}"
When I make a GET request to "/api/beta/monitoring/services?search={%22host.name%22:%22Centreon-Server%22}"
Then the response code should be 200
And the property "meta" has value
"""
Expand All @@ -77,7 +77,7 @@ Feature: Check health of the Monitoring - Service API
"""

Scenario: List one service of a host
When I make a GET request to "/api/latest/monitoring/hosts/14/services/19"
When I make a GET request to "/api/beta/monitoring/hosts/14/services/19"
Then the response code should be 200
And the response matched to the pattern
"""
Expand Down

0 comments on commit d3880ef

Please sign in to comment.