forked from langchain-ai/langchainjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add command to run export tests with docker
This provides a clean environment for each test, which doesnt have access to all the devDependencies we have in the repo. This simulates the experience of a user installing langchain in their own app
- Loading branch information
Showing
10 changed files
with
112 additions
and
18 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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
version: '3' | ||
services: | ||
test-exports-esm: | ||
image: node:18 | ||
working_dir: /app | ||
volumes: | ||
- ./test-exports-esm:/package | ||
- ./langchain:/langchain | ||
- ./scripts:/scripts | ||
command: bash /scripts/docker-ci-entrypoint.sh | ||
test-exports-cjs: | ||
image: node:18 | ||
working_dir: /app | ||
volumes: | ||
- ./test-exports-cjs:/package | ||
- ./langchain:/langchain | ||
- ./scripts:/scripts | ||
command: bash /scripts/docker-ci-entrypoint.sh | ||
test-exports-cra: | ||
image: node:18 | ||
working_dir: /app | ||
volumes: | ||
- ./test-exports-cra:/package | ||
- ./langchain:/langchain | ||
- ./scripts:/scripts | ||
command: bash /scripts/docker-ci-entrypoint.sh | ||
test-exports-cf: | ||
image: node:18 | ||
working_dir: /app | ||
volumes: | ||
- ./test-exports-cf:/package | ||
- ./langchain:/langchain | ||
- ./scripts:/scripts | ||
command: bash /scripts/docker-ci-entrypoint.sh | ||
success: | ||
image: alpine:3.14 | ||
command: echo "Success" | ||
depends_on: | ||
test-exports-esm: | ||
condition: service_completed_successfully | ||
test-exports-cjs: | ||
condition: service_completed_successfully | ||
test-exports-cra: | ||
condition: service_completed_successfully | ||
test-exports-cf: | ||
condition: service_completed_successfully |
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,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euxo pipefail | ||
|
||
cp -r ../package/* . | ||
|
||
# Replace the workspace dependency with the local copy, and install all others | ||
yarn add ../langchain | ||
|
||
# Check the build command completes successfully | ||
yarn build | ||
|
||
# Check the test command completes successfully | ||
yarn test |
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
File renamed without changes.
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,21 @@ | ||
import { unstable_dev } from "wrangler"; | ||
import type { UnstableDevWorker } from "wrangler"; | ||
import { describe, expect, it, beforeAll, afterAll } from "vitest"; | ||
|
||
describe("Worker", () => { | ||
let worker: UnstableDevWorker; | ||
|
||
beforeAll(async () => { | ||
worker = await unstable_dev("src/index.ts", { | ||
experimental: { disableExperimentalWarning: true }, | ||
}); | ||
}); | ||
|
||
afterAll(async () => { | ||
await worker.stop(); | ||
}); | ||
|
||
it("should start", async () => { | ||
expect(true).toBe(true); | ||
}); | ||
}); |
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