Skip to content
This repository has been archived by the owner on May 4, 2021. It is now read-only.

Commit

Permalink
Merge pull request #130 from dpn-admin/okcomputer-app-version
Browse files Browse the repository at this point in the history
Add the application semantic version to the OkComputer status details
  • Loading branch information
malakai97 authored Oct 28, 2016
2 parents 1c3039d + e2a13cf commit e748b2b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ branches:
services:
- mysql
- postgresql
- redis

env:
- DB=sqlite
Expand Down
8 changes: 8 additions & 0 deletions config/initializers/okcomputer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,11 @@

OkComputer::Registry.register 'resque_down', OkComputer::ResqueDownCheck.new
OkComputer.make_optional %w(resque_down)

# Simply report the application semantic version
class AppVersionCheck < OkComputer::Check
def check
mark_message "dpn-server: #{DPN::Server::Application::VERSION}"
end
end
OkComputer::Registry.register 'app_version', AppVersionCheck.new
18 changes: 18 additions & 0 deletions spec/integration/okcomputer_status_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2015 The Regents of the University of Michigan.
# All Rights Reserved.
# Licensed according to the terms of the Revised BSD License
# See LICENSE.md for details.

require 'rails_helper'

describe 'OkComputerStatus' do
describe 'GET /status' do
it 'returns application version' do
get '/status/all.json'
status_response = JSON.parse(response.body)
expect(status_response.keys).to include 'app_version'
message = status_response['app_version']['message']
expect(message).to include DPN::Server::Application::VERSION
end
end
end

0 comments on commit e748b2b

Please sign in to comment.