Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create agents with labels pre-set #267

Merged
merged 1 commit into from
May 12, 2022
Merged
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
12 changes: 4 additions & 8 deletions src/test/java/hudson/model/NodeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ public void before() {
@Issue("JENKINS-26391")
@Test
public void testGetAssignedLabelWithJobs() throws Exception {
final Node node = j.createOnlineSlave();
node.setLabelString("label1 label2");
final Node node = j.createSlave("label1 label2", null);
MavenModuleSet mavenProject = j.jenkins.createProject(MavenModuleSet.class, "p");
mavenProject.setAssignedLabel(j.jenkins.getLabel("label1"));
RunLoadCounter.prepare(mavenProject);
Expand All @@ -78,10 +77,8 @@ public Integer call() throws Exception {
@Issue("JENKINS-26391")
@Test
public void testGetAssignedLabelMultipleSlaves() throws Exception {
final Node node1 = j.createOnlineSlave();
node1.setLabelString("label1");
final Node node2 = j.createOnlineSlave();
node1.setLabelString("label1");
final Node node1 = j.createSlave("label1", null);
final Node node2 = j.createSlave("label1", null);

MavenModuleSet project = j.jenkins.createProject(MavenModuleSet.class, "p1");
final Label label = j.jenkins.getLabel("label1");
Expand All @@ -103,8 +100,7 @@ public void testGetAssignedLabelMultipleSlaves() throws Exception {
@Issue("JENKINS-26391")
@Test
public void testGetAssignedLabelWhenLabelRemoveFromProject() throws Exception {
final Node node = j.createOnlineSlave();
node.setLabelString("label1");
final Node node = j.createSlave("label1", null);

MavenModuleSet project = j.jenkins.createProject(MavenModuleSet.class, "p");
final Label label = j.jenkins.getLabel("label1");
Expand Down