Skip to content

Commit bc62186

Browse files
authored
Remove Go server from Python tests (#170)
Fixes #156
1 parent 0126e6e commit bc62186

File tree

20 files changed

+23
-1576
lines changed

20 files changed

+23
-1576
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ jobs:
3636
- uses: actions/setup-python@v4
3737
with:
3838
python-version: ${{ matrix.python }}
39-
# Needed for tests since they use external server
40-
- uses: actions/setup-go@v2
41-
with:
42-
go-version: "1.18"
4339
- run: python -m pip install --upgrade wheel poetry poethepoet
4440
- run: poetry install --no-root -E opentelemetry
4541
- run: poe lint
@@ -119,10 +115,6 @@ jobs:
119115
- run: poe fix-wheel
120116

121117
# Do test only for ci-arch auto (i.e. local machine)
122-
- if: ${{ matrix.ci-arch == 'auto' }}
123-
uses: actions/setup-go@v2
124-
with:
125-
go-version: "1.18"
126118
- if: ${{ matrix.ci-arch == 'auto' }}
127119
run: poe test-dist-single
128120

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,8 +1018,7 @@ The environment is now ready to develop in.
10181018

10191019
#### Testing
10201020

1021-
Tests currently require [Go](https://go.dev/) to be installed since they use an embedded Temporal server as a library.
1022-
With `Go` installed, run the following to execute tests:
1021+
To execute tests:
10231022

10241023
```bash
10251024
poe test

temporalio/testing/workflow.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ async def start_local(
8484
retry_config: Optional[temporalio.client.RetryConfig] = None,
8585
rpc_metadata: Mapping[str, str] = {},
8686
identity: Optional[str] = None,
87+
tls: bool | temporalio.client.TLSConfig = False,
8788
ip: str = "127.0.0.1",
8889
port: Optional[int] = None,
8990
download_dest_dir: Optional[str] = None,
@@ -128,6 +129,8 @@ async def start_local(
128129
:py:meth:`temporalio.client.Client.connect`.
129130
identity: See parameter of the same name on
130131
:py:meth:`temporalio.client.Client.connect`.
132+
tls: See parameter of the same name on
133+
:py:meth:`temporalio.client.Client.connect`.
131134
ip: IP address to bind to, or 127.0.0.1 by default.
132135
port: Port number to bind to, or an OS-provided port by default.
133136
download_dest_dir: Directory to download binary to if a download is
@@ -189,6 +192,7 @@ async def start_local(
189192
data_converter=data_converter,
190193
interceptors=interceptors,
191194
default_workflow_query_reject_condition=default_workflow_query_reject_condition,
195+
tls=tls,
192196
retry_config=retry_config,
193197
rpc_metadata=rpc_metadata,
194198
identity=identity,

tests/conftest.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
from temporalio.client import Client
2525
from temporalio.testing import WorkflowEnvironment
26-
from tests.helpers.golang import ExternalGolangServer
2726
from tests.helpers.worker import ExternalPythonWorker, ExternalWorker
2827

2928
# Due to https://github.com/python/cpython/issues/77906, multiprocessing on
@@ -55,18 +54,20 @@ def event_loop():
5554
loop.close()
5655

5756

58-
@pytest_asyncio.fixture(scope="session")
59-
async def golang_server() -> AsyncGenerator[ExternalGolangServer, None]:
60-
server = await ExternalGolangServer.start()
61-
yield server
62-
await server.close()
57+
@pytest.fixture(scope="session")
58+
def env_type(request: pytest.FixtureRequest) -> str:
59+
return request.config.getoption("--workflow-environment")
6360

6461

6562
@pytest_asyncio.fixture(scope="session")
66-
async def env(request) -> AsyncGenerator[WorkflowEnvironment, None]:
67-
env_type = request.config.getoption("--workflow-environment")
63+
async def env(env_type: str) -> AsyncGenerator[WorkflowEnvironment, None]:
6864
if env_type == "local":
69-
env = await WorkflowEnvironment.start_local()
65+
env = await WorkflowEnvironment.start_local(
66+
temporalite_extra_args=[
67+
"--dynamic-config-value",
68+
"system.forceSearchAttributesCacheRefreshOnRead=true",
69+
]
70+
)
7071
elif env_type == "time-skipping":
7172
env = await WorkflowEnvironment.start_time_skipping()
7273
else:

tests/helpers/golang.py

Lines changed: 0 additions & 94 deletions
This file was deleted.

tests/helpers/golangserver/certs/README.md

Lines changed: 0 additions & 2 deletions
This file was deleted.

tests/helpers/golangserver/certs/client-ca-cert.pem

Lines changed: 0 additions & 12 deletions
This file was deleted.

tests/helpers/golangserver/certs/client-ca-key.pem

Lines changed: 0 additions & 5 deletions
This file was deleted.

tests/helpers/golangserver/certs/client-cert.pem

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/helpers/golangserver/certs/client-key.pem

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)