How to use the @terascope/job-components.TestContext 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-op-test-harness / index.js View on Github external
constructor(op) {
        this.context = new TestContext('teraslice-op-test-harness');
        this.schema = jobSchema(this.context);
        this.events = this.context.apis.foundation.getSystemEvents();
        this.logger = this.context.logger;
        this.operationFn = op;
        // This is for backwards compatiblity
        this._jobSpec = executionSpec;
        bindThis(this, TestHarness);
    }
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;
    }