Skip to content

Commit 9297067

Browse files
committed
Fix the e2e test in vineyard operator.
Signed-off-by: Ye Cao <[email protected]>
1 parent 19badf1 commit 9297067

File tree

10 files changed

+50
-9
lines changed

10 files changed

+50
-9
lines changed

k8s/config/scheduler/config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ leaderElection:
99
profiles:
1010
- schedulerName: vineyard-scheduler
1111
plugins:
12+
filter:
13+
disabled:
14+
- name: "*"
15+
preScore:
16+
disabled:
17+
- name: "*"
1218
score:
1319
enabled:
1420
- name: Vineyard

k8s/test/e2e/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM ghcr.io/v6d-io/v6d/vineyard-python-dev:latest
15+
FROM ghcr.io/v6d-io/v6d/vineyard-python-dev:latest_x86_64
1616

1717
WORKDIR /
1818

k8s/test/e2e/assembly-demo/assembly-job1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def generate_df(index):
3131
stream = RecordBatchStream.new(vineyard_client)
3232
vineyard_client.persist(stream.id)
3333
print(stream.id)
34-
writer = stream.writer
34+
writer = stream.open_writer(vineyard_client)
3535
total_chunks = 10
3636
for idx in range(total_chunks):
3737
time.sleep(idx)

k8s/test/e2e/assembly-demo/assembly-local.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
stream_id = env_dist['STREAM_ID']
2626
stream = vineyard_client.get(stream_id)
27-
reader = stream.reader
27+
reader = stream.open_reader(vineyard_client)
2828

2929
index = 0
3030
global_meta = vineyard.ObjectMeta()

k8s/test/e2e/assembly-demo/distributed-job1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def generate_df(index):
3939

4040
sys.stdout = sys.__stdout__
4141
print(meta.id, flush=True)
42-
writer = stream.writer
42+
writer = stream.open_writer(vineyard_client)
4343
total_chunks = 10
4444
for idx in range(total_chunks):
4545
time.sleep(idx)

k8s/test/e2e/assembly-demo/distributed-job2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def generate_df(index):
4646
tup = vineyard_client.create_metadata(meta)
4747
vineyard_client.persist(tup)
4848

49-
writer = stream.writer
49+
writer = stream.open_writer(vineyard_client)
5050
total_chunks = 10
5151
for idx in range(total_chunks):
5252
time.sleep(idx)

k8s/test/e2e/deploy-raw-backup-and-recover/e2e.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,15 +185,15 @@ verify:
185185
- query: |
186186
kubectl get pod -l app=get-local-object -n vineyard-job -oname | \
187187
awk -F '/' '{print $2}' | \
188-
head -n 1 | \
188+
tail -n 1 | \
189189
xargs kubectl logs -n vineyard-job | \
190190
yq e '{"sum": .}' - | \
191191
yq e 'to_entries' -
192192
expected: ../verify/values.yaml
193193
- query: |
194194
kubectl get pod -l app=get-distributed-object -n vineyard-job -oname | \
195195
awk -F '/' '{print $2}' | \
196-
head -n 1 | \
196+
tail -n 1 | \
197197
xargs kubectl logs -n vineyard-job | \
198198
yq e '{"sum": .}' - | \
199199
yq e 'to_entries' -

k8s/test/e2e/serialize/e2e.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ verify:
5050
awk -F '/' '{print $2}' | \
5151
head -n 1 | \
5252
xargs kubectl logs -n vineyard-system | \
53+
grep "test passed" | \
5354
yq e '{"result": .}' - | \
5455
yq e 'to_entries' -
5556
expected: ../verify/serialize.yaml

python/vineyard/io/tests/test_stream.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def test_recordbatch_stream(vineyard_client):
4747
total_chunks = 10
4848

4949
def producer(stream: RecordBatchStream, dtypes, produced: List):
50-
writer = stream.writer
50+
writer = stream.open_writer(vineyard_client)
5151
for idx in range(total_chunks):
5252
time.sleep(idx)
5353
chunk = generate_random_dataframe(dtypes, 2) # np.random.randint(10, 100))
@@ -57,7 +57,7 @@ def producer(stream: RecordBatchStream, dtypes, produced: List):
5757
writer.finish()
5858

5959
def consumer(stream: RecordBatchStream, produced: List):
60-
reader = stream.reader
60+
reader = stream.open_reader(vineyard_client)
6161
index = 0
6262
while True:
6363
try:

test/runner.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,6 +1044,39 @@ def run_io_adaptor_tests(meta, allocator, endpoints, test_args):
10441044
)
10451045

10461046

1047+
def run_stream_test(meta, allocator, endpoints, test_args):
1048+
meta_prefix = 'vineyard_test_%s' % time.time()
1049+
metadata_settings = make_metadata_settings(meta, endpoints, meta_prefix)
1050+
1051+
with start_vineyardd(
1052+
metadata_settings,
1053+
['--allocator', allocator],
1054+
default_ipc_socket=VINEYARD_CI_IPC_SOCKET,
1055+
) as (_, rpc_socket_port):
1056+
start_time = time.time()
1057+
subprocess.check_call(
1058+
[
1059+
'pytest',
1060+
'-s',
1061+
'-vvv',
1062+
'--exitfirst',
1063+
'--durations=0',
1064+
'--log-cli-level',
1065+
'DEBUG',
1066+
'python/vineyard/io/tests',
1067+
*test_args,
1068+
'--vineyard-ipc-socket=%s' % VINEYARD_CI_IPC_SOCKET,
1069+
'--vineyard-endpoint=localhost:%s' % rpc_socket_port,
1070+
],
1071+
cwd=os.path.join(os.path.dirname(os.path.abspath(__file__)), '..'),
1072+
)
1073+
print(
1074+
'running python stream %s tests use %s seconds'
1075+
% (time.time() - start_time),
1076+
flush=True,
1077+
)
1078+
1079+
10471080
def run_fuse_test(meta, allocator, endpoints, test_args):
10481081
meta_prefix = 'vineyard_test_%s' % time.time()
10491082
metadata_settings = make_metadata_settings(meta, endpoints, meta_prefix)
@@ -1257,6 +1290,7 @@ def execute_tests(args):
12571290

12581291
if args.with_io:
12591292
run_io_adaptor_tests(args.meta, args.allocator, endpoints, python_test_args)
1293+
run_stream_test(args.meta, args.allocator, endpoints, python_test_args)
12601294

12611295
if args.with_fuse:
12621296
run_fuse_test(args.meta, args.allocator, endpoints, python_test_args)

0 commit comments

Comments
 (0)