Skip to content

Commit d66be34

Browse files
committed
fix custom image integration test
1 parent 34e8203 commit d66be34

File tree

3 files changed

+5
-17
lines changed

3 files changed

+5
-17
lines changed

.github/workflows/kubernetes-deploy.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ jobs:
8282
echo $GATEWAY_HOST
8383
# basic tests
8484
cd /home/runner/work/qiskit-serverless/qiskit-serverless/tests/basic
85-
rm 06_function.py
8685
for f in *.py; do echo "TEST: $f" && python "$f"; done
8786
# experimental tests
8887
cd /home/runner/work/qiskit-serverless/qiskit-serverless/tests/experimental

tests/basic/06_function.py

+3-10
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,12 @@
2121
provider=os.environ.get("PROVIDER_ID", "mockprovider"),
2222
description=help,
2323
)
24-
serverless.upload(function_with_custom_image)
24+
runnable_function = serverless.upload(function_with_custom_image)
2525

26-
my_functions = serverless.list()
27-
for function in my_functions:
28-
print("Name: " + function.title)
29-
print(function.description)
30-
print()
31-
32-
my_function = serverless.get("custom-image-function")
33-
job = my_function.run(message="Argument for the custum function")
26+
job = runnable_function.run(message="Argument for the custum function")
3427

3528
print(job.result())
3629
print(job.logs())
3730

38-
jobs = my_function.jobs()
31+
jobs = runnable_function.jobs()
3932
print(jobs)

tests/docker/test_docker.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,7 @@ def test_multiple_runs(self, base_client: BaseClient):
141141
assert isinstance(retrieved_job1.logs(), str)
142142
assert isinstance(retrieved_job2.logs(), str)
143143

144-
@mark.skip(
145-
reason="Images are not working in tests jet and "
146-
+ "LocalClient does not manage image instead of working_dir+entrypoint"
147-
)
148-
def test_error(self, base_client: BaseClient):
144+
def test_custom_image(self, serverless_client: BaseClient):
149145
"""Integration test to force an error."""
150146

151147
description = """
@@ -164,7 +160,7 @@ def test_error(self, base_client: BaseClient):
164160
description=description,
165161
)
166162

167-
runnable_function = base_client.upload(function_with_custom_image)
163+
runnable_function = serverless_client.upload(function_with_custom_image)
168164

169165
job = runnable_function.run(message="Argument for the custum function")
170166

0 commit comments

Comments
 (0)