Skip to content

Commit

Permalink
feat: allows which agent to use, defaults to use all available agents
Browse files Browse the repository at this point in the history
  • Loading branch information
kimpaller committed Nov 9, 2021
1 parent ba759ff commit 2c95365
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/sdg/Gauntlet.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,18 @@ def set_required_hardware(List board_names) {
gauntEnv.required_hardware = board_names
}

/**
* Set list of required agent for test
* @param agent_names list of strings of names of agent to use
* Strings must be associated with an existing agent.
* For example: sdg-nuc-01, master
*/
def set_required_agent(List agent_names) {
assert agent_names instanceof java.util.List
gauntEnv.required_agent = agent_names
gauntEnv.agents_online = getOnlineAgents()
}

/**
* Set URI source. Set URI source. Supported are ip or serial
* @param iio_uri_source String of URI source
Expand Down Expand Up @@ -1017,7 +1029,13 @@ private def getOnlineAgents() {
continue
}
if (!computer.offline) {
online_agents.add(computer.name)
if (!gauntEnv.required_agent.isEmpty()){
if (computer.name in gauntEnv.required_agent){
online_agents.add(computer.name)
}
}else{
online_agents.add(computer.name)
}
}
}
println(online_agents)
Expand Down
1 change: 1 addition & 0 deletions vars/getGauntEnv.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ private def call(hdlBranch, linuxBranch, bootPartitionBranch,firmwareVersion, bo
agents: [],
boards: [],
required_hardware: [],
required_agent: [],
firmware_boards: ['pluto','m2k'],
enable_docker: false,
docker_image: 'tfcollins/sw-ci:latest',
Expand Down

0 comments on commit 2c95365

Please sign in to comment.