feat: Implement rest api endpoint to test step
This commit is contained in:
@@ -9,6 +9,7 @@ import Telemetry from '../helpers/telemetry/index.js';
|
||||
import appConfig from '../config/app.js';
|
||||
import globalVariable from '../helpers/global-variable.js';
|
||||
import computeParameters from '../helpers/compute-parameters.js';
|
||||
import testRun from '../services/test-run.js';
|
||||
|
||||
class Step extends Base {
|
||||
static tableName = 'steps';
|
||||
@@ -156,6 +157,16 @@ class Step extends Base {
|
||||
return await App.findOneByKey(this.appKey);
|
||||
}
|
||||
|
||||
async test() {
|
||||
await testRun({ stepId: this.id });
|
||||
|
||||
const updatedStep = await this.$query()
|
||||
.withGraphFetched('lastExecutionStep')
|
||||
.patchAndFetch({ status: 'completed' });
|
||||
|
||||
return updatedStep;
|
||||
}
|
||||
|
||||
async getLastExecutionStep() {
|
||||
const lastExecutionStep = await this.$relatedQuery('executionSteps')
|
||||
.orderBy('created_at', 'desc')
|
||||
|
Reference in New Issue
Block a user