Skip to content

Conversation

@lindsnguyen
Copy link
Contributor

@lindsnguyen lindsnguyen commented Dec 22, 2025

Description

In tree-agent-langchain, when running integration tests the results are placed in different paths as the code currently doesn't handle having different working directories. This change figures out the the dirname using the new added file and adds the dir integration-test-results directory so that the test results can be written there. (Had to add ../../src/test/integration-test-results because the tests actually get run in lib/test not src/test.) Note that this dir was always created whenever integration tests were run but was never tracked by git and should continue to not be.

Reviewer Guidance

  • Originally tried to do it by relative path using the current file's location. Tried using import.meta.url but that wasn't defined in CommonJS. Tried directly using __dirname but that isn't defined in ESM
  • Followed other tests that needed this and added a new dirname.cjs file that exports the dirname properly.

Copilot AI review requested due to automatic review settings December 22, 2025 21:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an issue where integration test results were being placed in different directories depending on whether tests were run via npm (from package root) or the VS Code test runner (from test directory). The solution detects the current working directory and constructs the appropriate path to ensure results are consistently placed in the same root integration-test-results directory.

Key Changes

  • Replaced hardcoded path with a dynamic getResultsFolderPath() function
  • Added logic to detect execution context based on process.cwd()
  • Added join import from node:path for proper path construction

@lindsnguyen
Copy link
Contributor Author

@microsoft-github-policy-service agree company="Microsoft"

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@lindsnguyen
Copy link
Contributor Author

@microsoft-github-policy-service agree

@lindsnguyen lindsnguyen changed the title Fix result folder path for vscode run vs npm terminal run Fix result folder path to work for vscode and npm terminal runs Dec 23, 2025
@lindsnguyen lindsnguyen merged commit 853a965 into microsoft:main Dec 23, 2025
42 checks passed
@lindsnguyen lindsnguyen deleted the fix-path branch December 23, 2025 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants