Skip to content

Commit

Permalink
Slave -> agent in docs (#1288)
Browse files Browse the repository at this point in the history
Rename slave to agent in docs.
Rename SLAVE.md to AGENT.md
  • Loading branch information
jtnord authored Jul 21, 2023
1 parent 7e2bde2 commit ddbc115
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ without author's notice for the sake of suite reliability.
* Writing tests
* [Video tutorial](https://www.youtube.com/watch?v=ZHAiywgMG-M) by Kohsuke on how to write tests
* [Writing JUnit test](docs/JUNIT.md)
* [Testing slaves](docs/SLAVE.md)
* [Testing agents](docs/AGENT.md)
* [Hamcrest matchers](docs/MATCHERS.md)
* [EC2 provider configuration](docs/EC2-CONFIG.md)
* [Investigation](docs/INVESTIGATION.md)
Expand Down
24 changes: 12 additions & 12 deletions docs/SLAVE.md → docs/AGENT.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Testing Slaves
# Testing Agents
Just like [JenkinsController](CONTROLLER.md) allows test runners to test Jenkins with the environment of their choice,
this test harness allows test runners to control how slaves are set up to run tests.

For this purpose, we define `SlaveProvider` and `SlaveController`.

The `SlaveProvider` abstraction is such that a test case would simply request more slaves by calling
its `get()` method, and it's up to the implementation how this slave is provisioned and connected to Jenkins.
The `SlaveProvider` abstraction is such that a test case would simply request more agents by calling
its `get()` method, and it's up to the implementation how this agent is provisioned and connected to Jenkins.

For example, one implementation might launch an EC2 instance to run slaves in there, while another implementation
might just launch a slave locally on the same computer that the test harness is running (which happens to be the
For example, one implementation might launch an EC2 instance to run agents in there, while another implementation
might just launch an agent locally on the same computer that the test harness is running (which happens to be the
default implementation `LocalSlaveProvider`).

You can inject `SlaveProvider` to do this:
Expand All @@ -28,11 +28,11 @@ Or if your test case only needs one, you can just inject SlaveController directl

@Inject SlaveController slave;

In both cases, slaves are automatically shut down at the end of a test.
In both cases, agents are automatically shut down at the end of a test.

## SlaveController
`SlaveProvider.get()` call will return `SlaveController`, which encapsulates the actual logic slave
instantiation, but this call by itself doesn't yet result in a Jenkins instance connected to the said slave.
`SlaveProvider.get()` call will return `SlaveController`, which encapsulates the actual logic agent
instantiation, but this call by itself doesn't yet result in a Jenkins instance connected to the said agent.

That requires a separate call to the `install()` method:

Expand All @@ -42,13 +42,13 @@ That requires a separate call to the `install()` method:
@Inject
Jenkins jenkins;

// create a new slave on the given Jenkins and wait for it to become online
// create a new agent on the given Jenkins and wait for it to become online
Slave s = sc.install(jenkins).get();

Some slave launch methods (such as JNLP slaves) allow slaves to be explicitly stopped without getting
Some agent launch methods (such as JNLP agents) allow agents to be explicitly stopped without getting
automatically reconnected by Jenkins. The `stop()` and `start()` method provides these operations.
For other slave launch methods where Jenkins automatically tries to connect to a slave, these methods
For other agent launch methods where Jenkins automatically tries to connect to an agent, these methods
are no-op.

This is not to be confused with the "marking a slave as temporarily offline" feature in Jenkins, which
This is not to be confused with the "marking an agent as temporarily offline" feature in Jenkins, which
belongs to the `Slave` page object.
4 changes: 2 additions & 2 deletions docs/MACHINE.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ To run Jenkins on EC2 Machine with multi-tenant Machines:
...
}

Just like JenkinsController, you can also inject `SlaveController`. See [SlaveController](SLAVE.md) on how to bind Jenkins
masters and slaves as different SubWorlds.
Just like JenkinsController, you can also inject `SlaveController`. See [SlaveController](AGENT.md) on how to bind Jenkins
masters and agents as different SubWorlds.

## Machine pooling

Expand Down

0 comments on commit ddbc115

Please sign in to comment.