Skip to content

Commit

Permalink
infra[minor]: Add codecov to CI & run all unit tests in CI (langchain…
Browse files Browse the repository at this point in the history
…-ai#4126)

* infra[minor]: Add codecov to CI

* codecov.yml file

* cr

* cr

* update jest config collect coverage

* cr

* gen coverage

* rm rf coverage folders

* test all
  • Loading branch information
bracesproul authored Jan 23, 2024
1 parent da22f3c commit e935b89
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 4 deletions.
12 changes: 12 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
coverage:
status:
project:
default:
informational: true
patch:
default:
informational: true


# When modifying this file, please validate using
# curl -X POST --data-binary @codecov.yml https://codecov.io/validate
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ jobs:
- name: Install dependencies
run: yarn install --immutable
- name: Test
run: yarn run test:unit
run: yarn run test:unit -- --coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

test-exports:
uses:
Expand Down
1 change: 1 addition & 0 deletions langchain/jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ module.exports = {
setupFiles: ["dotenv/config"],
setupFilesAfterEnv: ["./scripts/jest-setup-after-env.js"],
testTimeout: 20_000,
collectCoverageFrom: ["src/**/*.ts"]
};
1 change: 1 addition & 0 deletions libs/create-langchain-integration/template/jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ module.exports = {
setupFiles: ["dotenv/config"],
testTimeout: 20_000,
passWithNoTests: true,
collectCoverageFrom: ["src/**/*.ts"],
};
1 change: 1 addition & 0 deletions libs/langchain-cloudflare/jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ module.exports = {
setupFiles: ["dotenv/config"],
testTimeout: 20_000,
passWithNoTests: true,
collectCoverageFrom: ["src/**/*.ts"],
};
1 change: 1 addition & 0 deletions libs/langchain-cohere/jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ module.exports = {
setupFiles: ["dotenv/config"],
testTimeout: 20_000,
passWithNoTests: true,
collectCoverageFrom: ["src/**/*.ts"],
};
1 change: 1 addition & 0 deletions libs/langchain-community/jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ module.exports = {
],
setupFiles: ["dotenv/config"],
testTimeout: 20_000,
collectCoverageFrom: ["src/**/*.ts"],
};
1 change: 1 addition & 0 deletions libs/langchain-google-genai/jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ module.exports = {
],
setupFiles: ["dotenv/config"],
testTimeout: 20_000,
collectCoverageFrom: ["src/**/*.ts"],
};
3 changes: 2 additions & 1 deletion libs/langchain-mistralai/jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ module.exports = {
],
setupFiles: ["dotenv/config"],
testTimeout: 20_000,
passWithNoTests: true
passWithNoTests: true,
collectCoverageFrom: ["src/**/*.ts"]
};
1 change: 1 addition & 0 deletions libs/langchain-pinecone/jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ module.exports = {
setupFiles: ["dotenv/config"],
testTimeout: 20_000,
passWithNoTests: true,
collectCoverageFrom: ["src/**/*.ts"]
};
3 changes: 2 additions & 1 deletion libs/langchain-scripts/jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ module.exports = {
],
setupFiles: ["dotenv/config"],
testTimeout: 20_000,
passWithNoTests: true
passWithNoTests: true,
collectCoverageFrom: ["src/**/*.ts"]
};
1 change: 1 addition & 0 deletions libs/langchain-yandex/jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ module.exports = {
setupFiles: ["dotenv/config"],
testTimeout: 20_000,
passWithNoTests: true,
collectCoverageFrom: ["src/**/*.ts"],
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"lint": "turbo run lint --concurrency 1",
"lint:fix": "turbo run lint:fix",
"test": "yarn test:unit && yarn workspace @langchain/core build && yarn workspace langchain build && yarn test:exports:docker",
"test:unit": "turbo run test --filter @langchain/core --filter langchain",
"test:unit": "turbo run test",
"test:int": "yarn run test:int:deps && turbo run test:integration ; yarn run test:int:deps:down",
"test:int:deps": "docker compose -f test-int-deps-docker-compose.yml up -d",
"test:int:deps:down": "docker compose -f test-int-deps-docker-compose.yml down",
Expand Down

0 comments on commit e935b89

Please sign in to comment.