flytekit icon indicating copy to clipboard operation
flytekit copied to clipboard

Add raw container (copilot) integration test

Open wayner0628 opened this issue 1 year ago • 3 comments

Tracking issue

https://github.com/flyteorg/flyte/issues/5930

Why are the changes needed?

To prevent in the future, someone writing code that will break the copilot.

What changes were proposed in this pull request?

Add code tests/flytekit/unit/core/test_local_raw_container.py to tests/flytekit/integration/remote/test_remote.py.

How was this patch tested?

Setup process

Screenshots

Check all the applicable boxes

  • [x] I updated the documentation accordingly.
  • [x] All new and existing tests passed.
  • [x] All commits are signed-off.

Related PRs

https://github.com/flyteorg/flytekit/pull/2887

Docs link

wayner0628 avatar Nov 03 '24 02:11 wayner0628

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 43.94%. Comparing base (6bf6f8e) to head (6efafae). Report is 6 commits behind head on master.

:exclamation: There is a different number of reports uploaded between BASE (6bf6f8e) and HEAD (6efafae). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (6bf6f8e) HEAD (6efafae)
4 3
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #2892       +/-   ##
===========================================
- Coverage   76.79%   43.94%   -32.86%     
===========================================
  Files         196      199        +3     
  Lines       20546    20781      +235     
  Branches     2646     2671       +25     
===========================================
- Hits        15779     9132     -6647     
- Misses       4068    11416     +7348     
+ Partials      699      233      -466     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Nov 03 '24 03:11 codecov[bot]

The current issue with this PR is that the integration test environment is unable to locate the Docker server needed to build the copilot image.

Not sure if it is this

@pytest.mark.skipif(
    sys.platform in ["darwin", "win32"],
    reason="Skip if running on windows or macos due to CI Docker environment setup failure",
)

makes the unittest environment able to pass the test

wayner0628 avatar Nov 04 '24 10:11 wayner0628

I tried using subprocess to build the image, but there's no docker command

line 22, in build_docker_image
    subprocess.run(
      File "/usr/local/lib/python3.9/subprocess.py", line 505, in run
    with Popen(*popenargs, **kwargs) as process:
      File "/usr/local/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
      File "/usr/local/lib/python3.9/subprocess.py", line 1837, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)

Message:

    FileNotFoundError: [Errno 2] No such file or directory: 'docker'

wayner0628 avatar Nov 04 '24 10:11 wayner0628