Files
Antonin StefanuttiandGitHub 03969c9217 [CI]: Kuberay operator e2e tests (#1575)
This PR adds e2e tests for the operator, following up #1539 (comment).

This e2e testing enables to assert Kuberay resources, in a way that cannot be achieved with existing tests (envtest).

The e2e tests execution output is post-processed using gotestfmt:

The logs and events are gathered and uploaded are part of the workflow run:
2023-11-07 09:57:52 -08:00

25 lines
499 B
Python

import ray
import os
ray.init()
@ray.remote
class Counter:
def __init__(self):
# Used to verify runtimeEnv
self.name = os.getenv("counter_name")
assert self.name == "test_counter"
self.counter = 0
def inc(self):
self.counter += 1
def get_counter(self):
return "{} got {}".format(self.name, self.counter)
counter = Counter.remote()
for _ in range(5):
ray.get(counter.inc.remote())
print(ray.get(counter.get_counter.remote()))