Skip to content

Commit 2c665b3

Browse files
authored
Revert "Changed tests to flows"
1 parent aabe85d commit 2c665b3

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

.npmignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
src/
2+
tests/

package.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
{
22
"name": "@stepci/runner",
3-
"version": "1.5.0",
3+
"version": "1.4.8",
44
"description": "Step CI Runner",
55
"main": "dist/index.js",
6-
"files": [
7-
"dist"
8-
],
96
"scripts": {
107
"build": "tsc -p tsconfig.json",
118
"build:watch": "tsc -w -p tsconfig.json",

src/index.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export type Workflow = {
2828
version: string
2929
name: string
3030
env?: EnvironmentVariables
31-
flows: flows
31+
tests: Tests
3232
components?: WorkflowComponents
3333
config?: WorkflowConfig
3434
}
@@ -61,7 +61,7 @@ type WorkflowOptionsSecrets = {
6161
export type WorkflowResult = {
6262
workflow: Workflow
6363
result: {
64-
flows: TestResult[]
64+
tests: TestResult[]
6565
passed: boolean
6666
timestamp: Date
6767
duration: number
@@ -76,7 +76,7 @@ export type Test = {
7676
config?: TestConfig
7777
}
7878

79-
export type flows = {
79+
export type Tests = {
8080
[key: string]: Test
8181
}
8282

@@ -395,13 +395,13 @@ export async function runFromFile (path: string, options?: WorkflowOptions): Pro
395395
export async function run (workflow: Workflow, options?: WorkflowOptions): Promise<WorkflowResult> {
396396
const timestamp = new Date()
397397
const env = { ...workflow.env ?? {}, ...options?.env ?? {} }
398-
const flows = await Promise.all(Object.entries(workflow.flows).map(([id, test]) => runTest(id, test, options, workflow.config, env, workflow.components)))
398+
const tests = await Promise.all(Object.values(workflow.tests).map((test, i) => runTest(Object.keys(workflow.tests)[i], test, options, workflow.config, env, workflow.components)))
399399

400400
const workflowResult: WorkflowResult = {
401401
workflow,
402402
result: {
403-
flows,
404-
passed: flows.every(test => test.passed),
403+
tests,
404+
passed: tests.every(test => test.passed),
405405
timestamp,
406406
duration: Date.now() - timestamp.valueOf()
407407
},

tests/test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const workflow = {
3030
}
3131
}
3232
},
33-
flows: {
33+
tests: {
3434
"example": {
3535
"steps": [
3636
{
@@ -62,4 +62,4 @@ const workflow = {
6262
}
6363

6464
const ee = new EventEmitter()
65-
run(workflow).then(({ result }) => console.log(result.flows[0].steps[0]))
65+
run(workflow).then(({ result }) => console.log(result.tests[0].steps[0]))

0 commit comments

Comments
 (0)