Skip to content

fix: copy over tests/__init__.py on docker build#5443

Merged
rguan72 merged 6 commits intomainfrom
richard/copy-over-init-py-into-dockerfile
Sep 18, 2025
Merged

fix: copy over tests/__init__.py on docker build#5443
rguan72 merged 6 commits intomainfrom
richard/copy-over-init-py-into-dockerfile

Conversation

@rguan72
Copy link
Contributor

@rguan72 rguan72 commented Sep 17, 2025

Description

context: https://onyx-company.slack.com/archives/C0771QKDBPE/p1758074441981789
also add braintrust tracing when running braintrust eval locally

How Has This Been Tested?

Running in CI/CD right now

Backporting (check the box to trigger backport action)

Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.

  • This PR should be backported (make sure to check that the backport attempt succeeds)
  • [Optional] Override Linear Check

Summary by cubic

Copies top-level test files into the integration test Docker image so tests/init.py is included, fixing import/package discovery issues.

  • Bug Fixes
    • Added COPY ./tests/* /app/tests/ to the integration test Dockerfile; previously only tests/integration was copied, omitting tests/init.py.

@rguan72 rguan72 requested a review from a team as a code owner September 17, 2025 19:18
@vercel
Copy link

vercel bot commented Sep 17, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
internal-search Ready Ready Preview Comment Sep 17, 2025 11:47pm

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This PR adds a COPY instruction to the integration test Dockerfile to include all files from the tests directory into the Docker image. Specifically, it copies tests/* to /app/tests/, which ensures that the tests/__init__.py file is available in the container.

The change addresses a Python packaging issue where the tests directory needs an __init__.py file to be properly recognized as a Python package. Without this file, any imports that reference modules in the tests directory would fail with import errors. The existing Dockerfile only copied the tests/integration subdirectory but missed the parent-level files like __init__.py.

This fix integrates with the existing Docker build process for integration tests and ensures the Python package structure is properly maintained in the containerized environment. The glob pattern ./tests/* copies all files (but not subdirectories) from the tests directory, which is the minimal change needed to include the missing __init__.py file.

Confidence score: 4/5

  • This PR is safe to merge with minimal risk as it only adds a missing file dependency
  • Score reflects the straightforward nature of the fix and low likelihood of breaking existing functionality
  • Pay attention to the glob pattern in the COPY instruction to ensure it doesn't include unintended files

1 file reviewed, 1 comment

Edit Code Review Bot Settings | Greptile

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="backend/tests/integration/Dockerfile">

<violation number="1" location="backend/tests/integration/Dockerfile:91">
Using COPY ./tests/* will also copy subdirectories (e.g., integration, regression, unit), duplicating integration and bloating the image. Copy only the needed file(s) instead.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

@rguan72 rguan72 disabled auto-merge September 17, 2025 23:44
@rguan72 rguan72 merged commit 0394eae into main Sep 18, 2025
53 of 54 checks passed
@rguan72 rguan72 deleted the richard/copy-over-init-py-into-dockerfile branch September 18, 2025 00:12
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.

2 participants