How to use the @terascope/job-components.makeExecutionContext function in @terascope/job-components

To help you get started, we’ve selected a few @terascope/job-components examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github terascope / teraslice / packages / teraslice-test-harness / src / job-harness.ts View on Github external
constructor(job: JobConfig, options: JobHarnessOptions) {
        const context = new TestContext(`job-harness:${job.name}`);
        context.assignment = options.assignment || Assignment.Worker;

        const jobSchema = makeJobSchema(context);
        const executionConfig = validateJobConfig(jobSchema, job) as ExecutionConfig;
        this.context = makeExecutionContext({
            context,
            executionConfig
        });
    }
github terascope / teraslice / packages / teraslice-test-harness / src / base-test-harness.ts View on Github external
constructor(job: JobConfig, options: JobHarnessOptions, assignment: Assignment) {
        const testName = [assignment, job.name].filter((s) => s).join(':');
        this.context = new TestContext(testName, {
            assignment,
            clients: options.clients,
        });

        this.events = this.context.apis.foundation.getSystemEvents();

        const config = this.makeContextConfig(job, options.assetDir);
        this.executionContext = makeExecutionContext(config) as U;
    }
github terascope / teraslice / packages / teraslice / lib / workers / context / execution-context.js View on Github external
module.exports = async function _makeExecutionContext(context, executionConfig) {
    const assetIds = await spawnAssetLoader(executionConfig.assets, context);

    return makeExecutionContext({
        context,
        executionConfig,
        terasliceOpPath,
        assetIds,
    });
};