Skip to content

Commit 911da3f

Browse files
authored
Merge pull request #1156 from golemfactory/scx1332/update_goth
Update goth to 0.17
2 parents 11bf4d0 + eae4238 commit 911da3f

File tree

19 files changed

+29
-73
lines changed

19 files changed

+29
-73
lines changed

.github/workflows/goth.yml

Lines changed: 8 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -14,75 +14,34 @@ on:
1414
jobs:
1515
goth-tests:
1616
name: Run integration tests
17-
runs-on: [goth, ubuntu-18.04]
17+
runs-on: ubuntu-latest
1818
steps:
19-
- name: install docker-compose
20-
run: |
21-
sudo curl -L "https://github.com/docker/compose/releases/download/1.28.4/docker-compose-Linux-x86_64" -o /usr/local/bin/docker-compose
22-
sudo chmod a+x /usr/local/bin/docker-compose
23-
24-
- name: install ffi and gcc
25-
run: sudo apt-get install -y libffi-dev build-essential
26-
2719
- name: Checkout
28-
uses: actions/checkout@v3
20+
uses: actions/checkout@v4
2921

3022
- name: Configure python
31-
uses: actions/setup-python@v4
23+
uses: actions/setup-python@v5
3224
with:
33-
python-version: '3.9'
25+
python-version: '3.10'
3426

35-
- name: Install and configure Poetry
36-
run: python -m pip install -U pip setuptools poetry==1.3.2
27+
- name: Install Poetry
28+
run: curl -sSL https://install.python-poetry.org | python3 - --version 1.8.2
3729

3830
- name: Install dependencies
3931
run: |
40-
poetry env use python3.9
4132
poetry install
4233
43-
- name: Disconnect Docker containers from default network
44-
continue-on-error: true
45-
# related to this issue: https://github.com/moby/moby/issues/23302
46-
run: |
47-
docker network inspect docker_default
48-
sudo apt-get install -y jq
49-
docker network inspect docker_default | jq ".[0].Containers | map(.Name)[]" | tee /dev/stderr | xargs --max-args 1 -- docker network disconnect -f docker_default
50-
51-
- name: Remove Docker containers
52-
continue-on-error: true
53-
run: docker rm -f $(docker ps -a -q)
54-
55-
- name: Restart Docker daemon
56-
# related to this issue: https://github.com/moby/moby/issues/23302
57-
run: sudo systemctl restart docker
58-
59-
- name: Log in to GitHub Docker repository
60-
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login docker.pkg.github.com -u ${{github.actor}} --password-stdin
61-
6234
- name: Initialize the test suite
6335
run: poetry run poe tests_integration_init
6436

6537
- name: Run test suite
6638
env:
67-
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6840
run: poetry run poe tests_integration
6941

7042
- name: Upload test logs
71-
uses: actions/upload-artifact@v2
43+
uses: actions/upload-artifact@v4
7244
if: always()
7345
with:
7446
name: goth-logs
7547
path: /tmp/goth-tests
76-
77-
# Only relevant for self-hosted runners
78-
- name: Remove test logs
79-
if: always()
80-
run: rm -rf /tmp/goth-tests
81-
82-
# Only relevant for self-hosted runners
83-
- name: Remove poetry virtual env
84-
if: always()
85-
# Python version below should agree with the version set up by this job.
86-
# In future we'll be able to use the `--all` flag here to remove envs for
87-
# all Python versions (https://github.com/python-poetry/poetry/issues/3208).
88-
run: poetry env remove python3.9

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ tests_unit = {cmd = "pytest --cov=yapapi --cov-report html --cov-report term -sv
8484
tests_integration_init = { sequence = ["_gothv_env", "_gothv_requirements", "_gothv_assets"], help="Initialize the integration test environment"}
8585
tests_integration = { cmd = ".envs/yapapi-goth/bin/python -m pytest -svx tests/goth_tests --config-override docker-compose.build-environment.use-prerelease=false --config-path tests/goth_tests/assets/goth-config.yml --ssh-verify-connection --reruns 3 --only-rerun AssertionError --only-rerun TimeoutError --only-rerun goth.runner.exceptions.TimeoutError --only-rerun goth.runner.exceptions.TemporalAssertionError --only-rerun urllib.error.URLError --only-rerun goth.runner.exceptions.CommandError --only-rerun requests.exceptions.ConnectionError --only-rerun OSError --only-rerun requests.exceptions.ReadTimeout", help = "Run the integration tests"}
8686
_gothv_env = "python -m venv .envs/yapapi-goth"
87-
_gothv_requirements = ".envs/yapapi-goth/bin/pip install -U --extra-index-url https://test.pypi.org/simple/ goth==0.14.1 pip pytest pytest-asyncio pytest-rerunfailures pexpect"
87+
_gothv_requirements = ".envs/yapapi-goth/bin/pip install -U --extra-index-url https://test.pypi.org/simple/ goth==0.17.0 pip pytest pytest-asyncio pytest-rerunfailures pexpect"
8888
_gothv_assets = ".envs/yapapi-goth/bin/python -m goth create-assets tests/goth_tests/assets"
8989

9090
clean = {cmd = "rm -rf .coverage .requirements.txt dist md handbook build", help = "Clean all development related files" }

tests/goth_tests/___test_resubscription.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ async def worker(work_ctx, tasks):
165165
async with Golem(
166166
budget=10.0,
167167
event_consumer=monitor.add_event_sync,
168-
payment_network="rinkeby",
168+
payment_network="holesky",
169169
) as golem:
170170
task: Task # mypy needs this for some reason
171171
async for task in golem.execute_tasks(

tests/goth_tests/test_agreement_termination/requestor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ async def worker(ctx: WorkContext, tasks):
4343
yield script
4444
else:
4545
# Simulate some work
46-
script.run("/bin/sleep", "5")
46+
script.run("/bin/sleep", "1")
4747
yield script
4848

4949
task.accept_result()
5050

5151
async with Golem(
5252
budget=10.0,
5353
subnet_tag="goth",
54-
payment_network="rinkeby",
54+
payment_network="holesky",
5555
) as golem:
5656
tasks = [Task(data=n) for n in range(6)]
5757
async for task in golem.execute_tasks(

tests/goth_tests/test_agreement_termination/test_agreement_termination.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,16 @@ async def test_agreement_termination(
8888

8989
# Wait for worker failure due to command error
9090
assertion = cmd_monitor.add_assertion(assert_command_error)
91-
agr_id = await assertion.wait_for_result(timeout=60)
91+
agr_id = await assertion.wait_for_result(timeout=120)
9292
logger.info("Detected command error in activity for agreement %s", agr_id)
9393

9494
# Make sure no new tasks are sent and the agreement is terminated
9595
assertion = cmd_monitor.add_assertion(
9696
partial(assert_agreement_cancelled, agr_id),
9797
name=f"assert_agreement_cancelled({agr_id})",
9898
)
99-
await assertion.wait_for_result(timeout=10)
99+
await assertion.wait_for_result(timeout=20)
100100

101101
# Wait for executor shutdown
102-
await cmd_monitor.wait_for_pattern("ShutdownFinished", timeout=60)
102+
await cmd_monitor.wait_for_pattern("ShutdownFinished", timeout=120)
103103
logger.info("Requestor script finished")

tests/goth_tests/test_async_task_generation/requestor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ async def worker(work_ctx, tasks):
2929
budget=10.0,
3030
subnet_tag="goth",
3131
event_consumer=log_event_repr,
32-
payment_network="rinkeby",
32+
payment_network="holesky",
3333
) as golem:
3434
# We use an async task generator that yields tasks removed from
3535
# an async queue. Each computed task will potentially spawn

tests/goth_tests/test_concurrent_executors/requestor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ async def duplicator(work_ctx, tasks):
5050
output = result.stdout.strip()
5151
task.accept_result(output)
5252

53-
async with Golem(budget=1.0, subnet_tag="goth", payment_network="rinkeby") as golem:
53+
async with Golem(budget=1.0, subnet_tag="goth", payment_network="holesky") as golem:
5454
# Construct a pipeline:
5555
#
5656
# input_tasks

tests/goth_tests/test_instance_restart/requestor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ async def shutdown(self):
8181

8282

8383
async def main():
84-
async with Golem(budget=1.0, subnet_tag="goth", payment_network="rinkeby") as golem:
84+
async with Golem(budget=1.0, subnet_tag="goth", payment_network="holesky") as golem:
8585
# Start a cluster with a single service.
8686
# The first instance will fail before reaching the `running` state
8787
# due to an error. Another instance should be spawned in its place.

tests/goth_tests/test_mid_agreement_payments/requestor_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ async def main():
4242
strategy=ShortDebitNoteIntervalAndPaymentTimeout(),
4343
subnet_tag="goth",
4444
event_consumer=log_event_repr,
45-
payment_network="rinkeby",
45+
payment_network="holesky",
4646
) as golem:
4747
logger = logging.getLogger("yapapi")
4848
logger.handlers[0].setLevel(logging.DEBUG)

tests/goth_tests/test_multiactivity_agreement/requestor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ async def worker(work_ctx, tasks):
2929
budget=10.0,
3030
subnet_tag="goth",
3131
event_consumer=log_event_repr,
32-
payment_network="rinkeby",
32+
payment_network="holesky",
3333
) as golem:
3434
tasks = [Task(data=n) for n in range(3)]
3535
async for task in golem.execute_tasks(

0 commit comments

Comments
 (0)