Skip to content

Commit

Permalink
Start adding merge
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Jan 2, 2022
1 parent a97ca67 commit 098e6dd
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
8 changes: 8 additions & 0 deletions src/bin/config/combinations.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,12 @@ Both the identifier and its type must be specified, such as --system.os=linux or
--system.node_version=node_16
Default: none`,
},
merge: {
group: HISTORY,
string: true,
requiresArg: true,
describe: `Merge this result with previous ones.
The value is an identifier. Results with the same identifier are merged.
Default: same as result's identifier`,
},
}
1 change: 1 addition & 0 deletions src/config/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const EXAMPLE_CONFIG = {
reporter: optionalArray('debug'),
reporterConfig: { debug: { property: true } },
system: { os: 'linux', node_version: 'node_8' },
merge: 'f0f13513-5267-43a9-a02a-60fdde0332d0',
limit: optionalArray('task_id=10'),
quiet: true,
force: true,
Expand Down
4 changes: 2 additions & 2 deletions src/run/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ export const createResult = async function (config) {

const createRawResult = async function (config) {
const combinations = await listCombinations(config)
const { id, timestamp, systems } = createSystemInfo(config)
return { id, timestamp, systems, combinations }
const { id, mergeId, timestamp, systems } = createSystemInfo(config)
return { id, mergeId, timestamp, systems, combinations }
}
7 changes: 6 additions & 1 deletion src/system/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,14 @@ import { getTimestamp } from './timestamp.js'
// and show them in the footer.
export const createSystemInfo = function (config) {
const id = uuidv4()
const mergeId = getMergeId(id, config)
const timestamp = getTimestamp()
const systems = getSystems(config)
return { id, timestamp, systems }
return { id, mergeId, timestamp, systems }
}

const getMergeId = function (id, { merge = id }) {
return merge
}

const getSystems = function ({ cwd, system: dimensions }) {
Expand Down

0 comments on commit 098e6dd

Please sign in to comment.