Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/dashboard/app/models/batch_connect/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,9 @@ def add_cluster_widget(attributes, attribute_list)
{
widget: 'select',
label: 'Cluster',
options: clusters.map(&:id)
options: clusters.map do |c|
[c&.metadata&.title || c.id.to_s.titleize, c.id]
end
}.merge(defined_cluster_attr)
else
{
Expand Down
48 changes: 24 additions & 24 deletions apps/dashboard/test/system/batch_connect_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ def stub_good_launch(dir)
visit new_batch_connect_session_context_url('sys/bc_jupyter')

# select oakley and 2 node types should be hidden
select('oakley', from: bc_ele_id('cluster'))
select('Oakley', from: bc_ele_id('cluster'))

# FIXME: no idea why .visible? doesn't work here. Selenium/chrome native still shows element as visible?
assert_equal 'display: none;', find_option_style('node_type', 'advanced')
assert_equal 'display: none;', find_option_style('node_type', 'hugemem')

# select owens and now they're available
select('owens', from: bc_ele_id('cluster'))
select('Owens', from: bc_ele_id('cluster'))
assert_equal '', find_option_style('node_type', 'advanced')
assert_equal '', find_option_style('node_type', 'hugemem')
end
Expand All @@ -56,7 +56,7 @@ def stub_good_launch(dir)
visit new_batch_connect_session_context_url('sys/bc_jupyter')

# select python 2.7 to initialize things
select('owens', from: bc_ele_id('cluster'))
select('Owens', from: bc_ele_id('cluster'))
select('any', from: bc_ele_id('node_type'))
select('2.7', from: bc_ele_id('python_version'))
assert_equal '', find_option_style('python_version', '2.7')
Expand All @@ -74,7 +74,7 @@ def stub_good_launch(dir)
visit new_batch_connect_session_context_url('sys/bc_jupyter')
assert_equal 7, find_max('bc_num_slots')
assert_equal 3, find_min('bc_num_slots')
select('owens', from: bc_ele_id('cluster'))
select('Owens', from: bc_ele_id('cluster'))

# change the node type and we should have some new min/max & value
select('gpu', from: bc_ele_id('node_type'))
Expand Down Expand Up @@ -160,13 +160,13 @@ def stub_good_launch(dir)
# max starts out at 7
visit new_batch_connect_session_context_url('sys/bc_jupyter')
assert_equal 7, find_max('bc_num_slots')
select('owens', from: bc_ele_id('cluster'))
select('Owens', from: bc_ele_id('cluster'))

select('gpu', from: bc_ele_id('node_type'))
assert_equal 28, find_max('bc_num_slots')

# changing the cluster changes the max
select('oakley', from: bc_ele_id('cluster'))
select('Oakley', from: bc_ele_id('cluster'))
assert_equal 40, find_max('bc_num_slots')
end

Expand All @@ -181,13 +181,13 @@ def stub_good_launch(dir)
assert_equal '100', find_value('bc_num_slots')

# toggle the cluster back and forth and it's still the same
select('oakley', from: bc_ele_id('cluster'))
select('owens', from: bc_ele_id('cluster'))
select('Oakley', from: bc_ele_id('cluster'))
select('Owens', from: bc_ele_id('cluster'))
assert_equal 100, find_min('bc_num_slots')
assert_equal 200, find_max('bc_num_slots')
assert_equal '100', find_value('bc_num_slots')

select('oakley', from: bc_ele_id('cluster'))
select('Oakley', from: bc_ele_id('cluster'))
assert_equal 100, find_min('bc_num_slots')
assert_equal 200, find_max('bc_num_slots')
assert_equal '100', find_value('bc_num_slots')
Expand Down Expand Up @@ -250,7 +250,7 @@ def stub_good_launch(dir)
assert_equal 88, find_max('bc_num_hours')

# change the cluster and these change again (the for clause)
select('oakley', from: bc_ele_id('cluster'))
select('Oakley', from: bc_ele_id('cluster'))
assert_equal 3, find_min('bc_num_slots')
assert_equal 40, find_max('bc_num_slots')
assert_equal 90, find_min('bc_num_hours')
Expand All @@ -265,12 +265,12 @@ def stub_good_launch(dir)
select('broken', from: bc_ele_id('node_type'))

# changing clusters does nothing.
select('owens', from: bc_ele_id('cluster'))
select('Owens', from: bc_ele_id('cluster'))
assert_equal 7, find_max('bc_num_slots')
assert_equal 3, find_min('bc_num_slots')
assert_equal '3', find_value('bc_num_slots')

select('oakley', from: bc_ele_id('cluster'))
select('Oakley', from: bc_ele_id('cluster'))
assert_equal 7, find_max('bc_num_slots')
assert_equal 3, find_min('bc_num_slots')
assert_equal '3', find_value('bc_num_slots')
Expand All @@ -292,20 +292,20 @@ def stub_good_launch(dir)
visit new_batch_connect_session_context_url('sys/bc_jupyter')
assert_equal '3', find_value('bc_num_slots')

select('owens', from: bc_ele_id('cluster'))
select('Owens', from: bc_ele_id('cluster'))
select('gpu', from: bc_ele_id('node_type'))
# value gets set to the new min
assert_equal '2', find_value('bc_num_slots')

# change clusters and it bumps up again
select('oakley', from: bc_ele_id('cluster'))
select('Oakley', from: bc_ele_id('cluster'))
assert_equal '3', find_value('bc_num_slots')

# edit the values, then change the cluster to ensure
# the change overwrites the edit
fill_in bc_ele_id('bc_num_slots'), with: 1
assert_equal '1', find_value('bc_num_slots')
select('owens', from: bc_ele_id('cluster'))
select('Owens', from: bc_ele_id('cluster'))
assert_equal '2', find_value('bc_num_slots')
end

Expand All @@ -316,13 +316,13 @@ def stub_good_launch(dir)
fill_in bc_ele_id('bc_num_slots'), with: 1000
assert_equal '1000', find_value('bc_num_slots')

select('owens', from: bc_ele_id('cluster'))
select('Owens', from: bc_ele_id('cluster'))
select('gpu', from: bc_ele_id('node_type'))
# value gets set to the new max
assert_equal '28', find_value('bc_num_slots')

# change clusters and it bumps up again
select('oakley', from: bc_ele_id('cluster'))
select('Oakley', from: bc_ele_id('cluster'))
assert_equal '40', find_value('bc_num_slots')
end

Expand Down Expand Up @@ -854,7 +854,7 @@ def check_visibility(hidden_id, expect_hidden)
assert_equal 40, find_max('bc_num_slots')

# now change the cluster and the max changes
select('oakley', from: bc_ele_id('cluster'))
select('Oakley', from: bc_ele_id('cluster'))
assert_equal 48, find_max('bc_num_slots')
end

Expand Down Expand Up @@ -1015,7 +1015,7 @@ def check_visibility(hidden_id, expect_hidden)
assert_equal 'display: none;', find_option_style('auto_modules_intel', 'intel/18.0.4')

# select oakley and now they're available
select('oakley', from: bc_ele_id('cluster'))
select('Oakley', from: bc_ele_id('cluster'))
assert_equal 'app_jupyter', find_value('auto_modules_app_jupyter')
assert_equal '', find_option_style('auto_modules_app_jupyter', 'app_jupyter/3.1.18')
assert_equal '', find_option_style('auto_modules_app_jupyter', 'app_jupyter/0.35.6')
Expand Down Expand Up @@ -1058,7 +1058,7 @@ def check_visibility(hidden_id, expect_hidden)
assert_equal 'owens', find_value('cluster')

# oakley has the hidden intel module 'intel/2021.4.0'
select('oakley', from: bc_ele_id('cluster'))
select('Oakley', from: bc_ele_id('cluster'))

actual_options = find_all_options('auto_modules_intel', nil).map(&:text)

Expand Down Expand Up @@ -1103,7 +1103,7 @@ def check_visibility(hidden_id, expect_hidden)
assert_equal '', find_option_style('auto_accounts', 'pzs1124')

# pzs0715 is available on oakely, so switching clusters should keep the same value.
select('oakley', from: bc_ele_id('cluster'))
select('Oakley', from: bc_ele_id('cluster'))
assert_equal 'pzs0715', find_value('auto_accounts')

# now these are hidden when oakley is chosen
Expand Down Expand Up @@ -1186,7 +1186,7 @@ def check_visibility(hidden_id, expect_hidden)
assert_selector("##{bc_ele_id('auto_queues')} option[value='systems']", count: 0)

# batch exists on both clusters, so switching clusters does nothing
select('oakley', from: bc_ele_id('cluster'))
select('Oakley', from: bc_ele_id('cluster'))
assert_equal 'batch', find_value('auto_queues')

# now those oakley queues are available
Expand Down Expand Up @@ -1216,7 +1216,7 @@ def check_visibility(hidden_id, expect_hidden)
assert_equal 'owens', find_value('cluster')
assert_equal 'pzs0715', find_value('auto_accounts')

select('oakley', from: bc_ele_id('cluster'))
select('Oakley', from: bc_ele_id('cluster'))

# condo-osumed queues are disabled, but the backfill-serial variants are.
assert_equal('display: none;', find_option_style('auto_queues', 'condo-osumed-cpu-40core'))
Expand Down Expand Up @@ -1293,7 +1293,7 @@ def check_visibility(hidden_id, expect_hidden)
assert_equal 'owens-default', find_value('auto_qos')

# change the cluster, and qos changes but account stays the same
select('oakley', from: bc_ele_id('cluster'))
select('Oakley', from: bc_ele_id('cluster'))
assert_equal 'oakley-default', find_value('auto_qos')
assert_equal 'pzs1124', find_value('auto_accounts')
end
Expand Down