diff --git a/gitlab-runner-mock/src/lib.rs b/gitlab-runner-mock/src/lib.rs index e75b00f..6030bb2 100644 --- a/gitlab-runner-mock/src/lib.rs +++ b/gitlab-runner-mock/src/lib.rs @@ -134,6 +134,16 @@ impl GitlabRunnerMock { jobs.jobs.push(job); } + pub fn get_job_artifact(&self, id: u64) -> Option> { + let jobs = self.inner.jobs.lock().unwrap(); + + jobs + .jobs + .iter() + .find(|j| j.id() == id) + .map(|j| j.artifact().as_slice().to_vec()) + } + fn grab_pending_job(&self) -> Option { let jobs = self.inner.jobs.lock().unwrap(); for job in jobs.jobs.iter() {