Skip to content

Commit

Permalink
Rename output_directory to log_location
Browse files Browse the repository at this point in the history
  • Loading branch information
euler-room committed Nov 4, 2024
1 parent 6956c0c commit d54be63
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion apps/dashboard/app/controllers/launchers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class LaunchersController < ApplicationController
:bc_num_slots, :bc_num_slots_fixed, :bc_num_slots_min, :bc_num_slots_max,
:bc_num_hours, :bc_num_hours_fixed, :bc_num_hours_min, :bc_num_hours_max,
:auto_job_name, :auto_job_name_fixed,
:auto_output_directory, :auto_output_directory_fixed, :auto_output_directory_exclude
:auto_log_location, :auto_log_location_fixed, :auto_log_location_exclude
].freeze

def new
Expand Down
4 changes: 2 additions & 2 deletions apps/dashboard/app/helpers/launchers_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ def auto_cores_template
create_editable_widget(script_form_double, attrib)
end

def auto_output_directory_template
attrib = SmartAttributes::AttributeFactory.build_auto_output_directory
def auto_log_location_template
attrib = SmartAttributes::AttributeFactory.build_auto_log_location
create_editable_widget(script_form_double, attrib)
end
# We need a form builder to build the template divs. These are
Expand Down
4 changes: 2 additions & 2 deletions apps/dashboard/app/javascript/launcher_edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ const newFieldData = {
label: "Job Name",
help: "The name the job will have."
},
auto_output_directory: {
label: "Log Output Directory",
auto_log_location: {
label: "Log Location",
help: "The destination of the job's log output."
},
bc_num_slots: {
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/app/lib/smart_attributes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module SmartAttributes
require 'smart_attributes/attributes/auto_groups'
require 'smart_attributes/attributes/auto_job_name'
require 'smart_attributes/attributes/auto_modules'
require 'smart_attributes/attributes/auto_output_directory'
require 'smart_attributes/attributes/auto_log_location'
require 'smart_attributes/attributes/auto_primary_group'
require 'smart_attributes/attributes/auto_queues'
require 'smart_attributes/attributes/auto_qos'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ class AttributeFactory
# Build this attribute object. Must specify a valid directory in opts
#
# @param opts [Hash] attribute's options
# @return [Attributes::AutoOutputDirectory] the attribute object
def self.build_auto_output_directory(opts = {})
Attributes::AutoOutputDirectory.new('auto_output_directory', opts)
# @return [Attributes::AutoLogLocation] the attribute object
def self.build_auto_log_location(opts = {})
Attributes::AutoLogLocation.new('auto_log_location', opts)
end
end

module Attributes
class AutoOutputDirectory < Attribute
# Value of auto_output_directory attribute
class AutoLogLocation < Attribute
# Value of auto_log_location attribute
# Defaults to first script path in the project
# @return [String] attribute value
def value
Expand All @@ -25,7 +25,7 @@ def widget
end

def label(*)
(opts[:label] || 'Output Directory').to_s
(opts[:label] || 'Log Location').to_s
end

# Submission hash describing how to submit this attribute
Expand Down
4 changes: 2 additions & 2 deletions apps/dashboard/app/views/launchers/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@
<%= auto_cores_template %>
</template>

<template id="auto_output_directory_template">
<%= auto_output_directory_template %>
<template id="auto_log_location_template">
<%= auto_log_location_template %>
</template>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
require 'smart_attributes'

module SmartAttributes
class AutoOutputDirectoryTest < ActiveSupport::TestCase
class AutoLogLocationTest < ActiveSupport::TestCase
def setup
stub_clusters
stub_user
Expand All @@ -20,22 +20,22 @@ def dynamic_env
test 'correctly sets the user supplied value' do
with_modified_env(dynamic_env) do
options = {
value: 'output_extravaganza',
label: 'Output Directory'
value: 'logerrific_local',
label: 'Log Location'
}
attribute = SmartAttributes::AttributeFactory.build('auto_output_directory', options)
attribute = SmartAttributes::AttributeFactory.build('auto_log_location', options)

assert_equal('output_extravaganza', attribute.value)
assert_equal('logerrific_local', attribute.value)
end
end

test 'correctly sets the default value in place of empty string' do
with_modified_env(dynamic_env) do
options = {
value: '',
label: 'Output Directory'
label: 'Log Location'
}
attribute = SmartAttributes::AttributeFactory.build('auto_output_directory', options)
attribute = SmartAttributes::AttributeFactory.build('auto_log_location', options)

assert_equal(nil, attribute.value)
end
Expand All @@ -45,9 +45,9 @@ def dynamic_env
with_modified_env(dynamic_env) do
options = {
value: nil,
label: 'Output Directory'
label: 'Log Location'
}
attribute = SmartAttributes::AttributeFactory.build('auto_output_directory', options)
attribute = SmartAttributes::AttributeFactory.build('auto_log_location', options)

assert_equal(nil, attribute.value)
end
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/test/system/project_manager_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ def add_auto_environment_variable(project_id, script_id, save: true)
expected_new_options = [
'bc_num_hours', 'auto_queues', 'bc_num_slots', 'auto_cores',
'auto_accounts', 'auto_job_name', 'auto_environment_variable',
'auto_output_directory'
'auto_log_location'
].to_set
assert_equal expected_new_options, actual_new_options
end
Expand Down

0 comments on commit d54be63

Please sign in to comment.