-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add rake task for getting squeue text output (#841)
Add a rake task for getting squeue text output to help with generating test fixtures.
- Loading branch information
Showing
2 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
require "bundler/gem_tasks" | ||
require "rspec/core/rake_task" | ||
|
||
require_relative 'lib/tasks/slurm' | ||
|
||
RSpec::Core::RakeTask.new(:spec) | ||
|
||
task :default => :spec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative '../ood_core' | ||
require_relative '../ood_core/job/adapters/slurm' | ||
|
||
namespace :slurm do | ||
|
||
desc 'Get squeue output in the format this gem expects' | ||
task :squeue do | ||
fields = OodCore::Job::Adapters::Slurm::Batch.new.all_squeue_fields | ||
args = OodCore::Job::Adapters::Slurm::Batch.new.squeue_args(options: fields.values) | ||
|
||
single_job = `squeue #{args.join(' ')}`.split("\n")[0...2] | ||
|
||
puts single_job | ||
end | ||
end |