-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* compiler: support multiple adaptors when handling imports * cli: add support for multiple adaptors on compiler * compiler: don't extract common exports * compiler: be more specific about how we calculate function exports * remove the adaptors prop * cli: working through adaptor -> adaptors changes Not done yet * cli: fix remaining tests after refactor * worker: refactor to support adaptors array * various: yet another type restructure to handle adaptors safely * cli:type tweak * compiler: update tests * fix type * engine: fix test * tests: fix execute tests * engine: fix another test * worker: more typings * tidyup monorepo in preloadAdaptorExports * worker: automatically append the collections adaptor to steps that need it * runtime: support global congfiguration on state assembly * runtime: support global credentials * worker: create global credential for collections * fixse * worker: accept collections version from CLI and refactor some stuff * worker: lookup latest collections version on server start * worker: changeset * worker: update tests * types * tests: force collections token to stop lookups * tests: add test for collections * engine: remove .only * typo * worker: fix collections version * collections: use latest rather than next * versions * worker: support @Local adaptor versions * changeset * worker: hook up monorepoDir argument * runtime: allow a specifier to include a file path * runtime:test * runtime: changeset * engine: don't try to autoinstall adaptors with an explicit path * worker: fix env var * worker: drive collections url from a new option * worker: logging around collections url * cleaner implementation of local adaptor paths * runtime: revert linker change * more cleanup * update tests * tests: integration test for worker monorepo * fix test * versions * engine: fix an issue where local adaptors don't load exports properly
- Loading branch information
1 parent
591bcc8
commit 451a3fd
Showing
82 changed files
with
1,332 additions
and
687 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "@openfn/integration-tests-execute", | ||
"private": true, | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Job execution tests", | ||
"author": "Open Function Group <[email protected]>", | ||
"license": "ISC", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
function fortyTwo() { | ||
return (state) => { | ||
state.data = 42; | ||
return state; | ||
}; | ||
} | ||
|
||
module.exports = { fortyTwo }; |
7 changes: 7 additions & 0 deletions
7
integration-tests/worker/monorepo/packages/common/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "@openfn/language-common", | ||
"private": true, | ||
"version": "1.0.0", | ||
"dependencies": {}, | ||
"devDependencies": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "@openfn/integration-tests-worker", | ||
"private": true, | ||
"version": "1.0.62", | ||
"version": "1.0.63", | ||
"description": "Lightning WOrker integration tests", | ||
"author": "Open Function Group <[email protected]>", | ||
"license": "ISC", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ test.before(async () => { | |
repoDir: path.resolve('tmp/repo/attempts'), | ||
}, | ||
{ | ||
collectionsVersion: '1.0.0-next-f802225c', | ||
runPublicKey: keys.public, | ||
} | ||
)); | ||
|
@@ -49,8 +50,8 @@ const run = async (t, attempt) => { | |
// TODO friendlier job names for this would be nice (rather than run ids) | ||
t.log( | ||
`run ${payload.step_id} done in ${payload.duration / 1000}s [${humanMb( | ||
payload.mem.job | ||
)} / ${humanMb(payload.mem.system)}mb] [thread ${payload.thread_id}]` | ||
payload.mem?.job | ||
)} / ${humanMb(payload.mem?.system)}mb] [thread ${payload.thread_id}]` | ||
); | ||
}); | ||
lightning.on('run:complete', (evt) => { | ||
|
@@ -248,3 +249,36 @@ test.serial('use different versions of the same adaptor', async (t) => { | |
t.log(result); | ||
t.falsy(result.errors); | ||
}); | ||
|
||
test.serial('Run with collections', async (t) => { | ||
const job1 = createJob({ | ||
body: `fn((state = {}) => { | ||
const server = collections.createMockServer(); | ||
collections.setMockClient(server); | ||
server.api.createCollection('collection'); | ||
state.data = [{ id: 'a' }, { id: 'b' }, { id: 'c' }]; | ||
state.results = []; | ||
return state; | ||
}); | ||
collections.set('collection', v => v.id, $.data); | ||
collections.each('collection', '*', (state, value, key) => { | ||
state.results.push({ key, value }) | ||
}); | ||
`, | ||
// Note: for some reason 1.7.0 fails because it exports a collections ?? | ||
// 1.7.4 seems fine | ||
adaptor: '@openfn/[email protected]', | ||
}); | ||
const attempt = createRun([], [job1], []); | ||
|
||
const { results } = await run(t, attempt); | ||
t.deepEqual(results, [ | ||
{ key: 'a', value: { id: 'a' } }, | ||
{ key: 'b', value: { id: 'b' } }, | ||
{ key: 'c', value: { id: 'c' } }, | ||
]); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.