Closed rameshkrishna closed 2 weeks ago
Hey there, @rameshkrishna! 👋 I'm here to help you out with any bugs, questions, or contributions while you wait for a human maintainer. Let's squash those bugs together!
To resolve the GitHub workflow failure related to the unrecognized named-value 'matrix' in the unit tests for LangChain.js integrations after PR 5733, you need to ensure that the matrix
context is correctly referenced in the workflow file. The provided workflow configuration appears correct, but the error might be due to a syntax issue or a missing context.
Here is the corrected and verified workflow configuration:
name: Unit Tests (LangChain Integrations)
on:
push:
branches: ["main"]
pull_request:
# Only run when LangChain Core, or integration package code changes.
paths:
- 'langchain-core/**'
- 'libs/**/**'
workflow_dispatch: # Allows triggering the workflow manually in GitHub UI
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
get-changed-files:
runs-on: ubuntu-latest
outputs:
changed_files: ${{ steps.get_changes.outputs.changed_files }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Get changes
id: get_changes
run: |
echo "changed_files<<EOF" >> $GITHUB_OUTPUT
git diff --name-only -r HEAD^1 HEAD | while read line; do printf "%s\n" "$line"; done >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
unit-tests:
name: Unit Tests
needs: get-changed-files
strategy:
matrix:
os: [ubuntu-latest]
node-version: [18.x, 20.x]
package: [anthropic, azure-openai, cloudflare, cohere, community, exa, google-common, google-gauth, google-genai, google-vertexai, google-vertexai-web, google-webauth, groq, mistralai, mongo, nomic, openai, pinecone, qdrant, redis, textsplitters, weaviate, yandex]
runs-on: ${{ matrix.os }}
if: contains(needs.get-changed-files.outputs.changed_files, 'langchain-core/') || contains(needs.get-changed-files.outputs.changed_files, 'libs/langchain-${{ matrix.package }}/')
env:
PUPPETEER_SKIP_DOWNLOAD: "true"
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "true"
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable
- name: Test '@langchain/${{ matrix.package }}' package
run: yarn test:unit:ci --filter=@langchain/${{ matrix.package }}
Ensure that the matrix
context is correctly referenced in the runs-on
and node-version
fields, and that the if
condition correctly checks for changes in the relevant paths. This should resolve the issue with the unrecognized named-value 'matrix' [1][2][3].
To continue talking to Dosu, mention @dosu.
issue fixed and PR closed #5768
Checked other resources
Example Code
Here is the current implementation that's causing integration test workflow failures:
Here is my implementation to fix the issue.
Error Message and Stack Trace (if applicable)
Description
Example of recent failure of the workflow on main branch
https://github.com/langchain-ai/langchainjs/actions/runs/9570862663
System Info
Platform : Ubuntu Node: 18 and 20