argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
17.84k stars 5.45k forks source link

Add additional websocket tests #19550

Open reggie-k opened 2 months ago

reggie-k commented 2 months ago

Summary

The websocket functionality for pod exec needs further unit testing and e2e testing.

Motivation

Currently only the surrounding functionality is being tested (such as permission validation, testing server connection, etc)

Proposal

Unit tests for read and write: https://github.com/argoproj/argo-cd/blob/master/server/application/websocket.go#L163 https://github.com/argoproj/argo-cd/blob/master/server/application/websocket.go#L213

New e2e tests are also needed.

The PR for this should be prefixed with test:

nitishfy commented 2 months ago

Hi, I'd like to take this up. Can you provide me answers for a couple of questions here:

  1. How can I test the websocket functionality for pod exec locally? Has this documented somewhere?
  2. We are required to add the unit tests for the above functions you've added in the issue description, correct?