Skip to content

Commit 78286e7

Browse files
allow specifying the job id that the results should be associated with
1 parent 4997ccd commit 78286e7

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ Important:
7070

7171
By default the plugin will not follow symlinked folders, set this option to `true` to do so. This will add the `-L` option to the `find` command used to get the files to upload.
7272

73+
#### `job-id` (string)
74+
75+
The buildkite job id for which the results should be linked to. Defaults to the current job.
76+
7377
#### `missing-error` (integer)
7478

7579
Exit code of the hook when no files are found to upload as long as the step's command has not failed already.
@@ -153,7 +157,7 @@ You can also use build artifacts generated in a previous step:
153157

154158
```yaml
155159
steps:
156-
# Run tests and upload
160+
# Run tests and upload
157161
- label: "🔨 Test"
158162
command: "make test --junit=tests-N.xml"
159163
artifact_paths: "tests-*.xml"

hooks/pre-exit

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ TIMEOUT="${BUILDKITE_PLUGIN_TEST_COLLECTOR_TIMEOUT:-30}"
77
BASE_PATH="${BUILDKITE_PLUGIN_TEST_COLLECTOR_BASE_PATH:-.}"
88
ANNOTATE="${BUILDKITE_PLUGIN_TEST_COLLECTOR_ANNOTATION_LINK:-false}"
99
UPLOAD_CONCURRENCY="${BUILDKITE_PLUGIN_TEST_COLLECTOR_UPLOAD_CONCURRENCY:-1}"
10+
JOB_ID="${BUILDKITE_PLUGIN_TEST_COLLECTOR_JOB_ID:-BUILDKITE_JOB_ID}"
1011
REPORT_URLS_FILE=$(mktemp)
1112
CURL_RESP_FILE="${CURL_RESP_FILE:-}"
1213
DEBUG="false"
@@ -126,7 +127,7 @@ upload() {
126127
"--form" "run_env[branch]=\"$BUILDKITE_BRANCH\""
127128
"--form" "run_env[commit_sha]=\"$BUILDKITE_COMMIT\""
128129
"--form" "run_env[number]=\"$BUILDKITE_BUILD_NUMBER\""
129-
"--form" "run_env[job_id]=\"$BUILDKITE_JOB_ID\""
130+
"--form" "run_env[job_id]=\"$JOB_ID\""
130131
"--form" "run_env[message]=\"$BUILDKITE_MESSAGE\""
131132
"--form" "run_env[collector]=test-collector-buildkite-plugin"
132133
)

plugin.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ configuration:
2929
enum:
3030
- json
3131
- junit
32+
job-id:
33+
type: string
3234
missing-error:
3335
type: integer
3436
timeout:

0 commit comments

Comments
 (0)