Skip to content

Commit

Permalink
Repo manager fix (#46)
Browse files Browse the repository at this point in the history
* Fix repo-manager deleting last line

Signed-off-by: jamshale <[email protected]>

* Remove basic_messages install in integration tests

Signed-off-by: jamshale <[email protected]>

* Remove orphans

Signed-off-by: jamshale <[email protected]>

---------

Signed-off-by: jamshale <[email protected]>
  • Loading branch information
jamshale authored Dec 1, 2023
1 parent e9198d7 commit 220d71c
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 13 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pr-integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ jobs:
for dir in ${{ steps.changed-plugins.outputs.changed-plugins }}; do
echo "Running integration tests for $dir"
cd $dir/integration
docker compose down --remove-orphans
docker compose build
docker compose run tests
cd ../..
Expand Down
1 change: 1 addition & 0 deletions basicmessage_storage/integration/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ requests = "^2.31.0"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

1 change: 1 addition & 0 deletions basicmessage_storage/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,5 @@ output = "test-reports/coverage.xml"

[build-system]
requires = ["setuptools", "poetry-core>=1.2"]
build-backend = "poetry.core.masonry.api"

1 change: 1 addition & 0 deletions connection_update/integration/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ requests = "^2.31.0"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

1 change: 1 addition & 0 deletions connection_update/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,5 @@ output = "test-reports/coverage.xml"

[build-system]
requires = ["setuptools", "poetry-core>=1.2"]
build-backend = "poetry.core.masonry.api"

1 change: 1 addition & 0 deletions multitenant_provider/integration/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ typing-extensions = "4.5.0"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

1 change: 1 addition & 0 deletions multitenant_provider/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,5 @@ output = "test-reports/coverage.xml"

[build-system]
requires = ["setuptools", "poetry-core>=1.2"]
build-backend = "poetry.core.masonry.api"

2 changes: 1 addition & 1 deletion redis_events/docker/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ endpoint:

plugin:
- redis_events.v1_0.redis_queue.events
- basicmessage_storage.v1_0
# - basicmessage_storage.v1_0

plugin-config: plugins-config.yml

Expand Down
2 changes: 1 addition & 1 deletion redis_events/integration/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ WORKDIR /usr/src/app
COPY --from=base /usr/src/app/.venv /usr/src/app/.venv
ENV PATH="/usr/src/app/.venv/bin:$PATH"

RUN pip install git+https://github.com/hyperledger/aries-acapy-plugins@main#subdirectory=basicmessage_storage
# RUN pip install git+https://github.com/hyperledger/aries-acapy-plugins@main#subdirectory=basicmessage_storage

COPY redis_events/ redis_events/
COPY docker/*.yml ./
Expand Down
1 change: 1 addition & 0 deletions redis_events/integration/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ uvicorn = "0.16.0"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

20 changes: 10 additions & 10 deletions redis_events/integration/tests/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ async def test_outbound_queue_removes_messages_from_queue_and_deliver_sends_them
retry_pop_count = retry_pop_count + 1
time.sleep(1)
msg_received = True
messages = faber.retrieve_basicmessages()['results']
assert "Hello Alice" in (msg['content'] for msg in messages)
assert "Another Alice" in (msg['content'] for msg in messages)
# messages = faber.retrieve_basicmessages()['results']
# assert "Hello Alice" in (msg['content'] for msg in messages)
# assert "Another Alice" in (msg['content'] for msg in messages)


@pytest.mark.asyncio
Expand All @@ -97,11 +97,11 @@ async def test_deliverer_pulls_messages_from_queue_and_sends_them(
)

time.sleep(5)
messages = faber.retrieve_basicmessages()['results']
matching_msgs = [
msg for msg in messages if msg['content'] == "test-msg"]
assert matching_msgs.__len__() == 2 # 1 for sent, 1 for received
assert await redis.lrange("acapy_outbound", 0, -1) == []
# messages = faber.retrieve_basicmessages()['results']
# matching_msgs = [
# msg for msg in messages if msg['content'] == "test-msg"]
# assert matching_msgs.__len__() == 2 # 1 for sent, 1 for received
# assert await redis.lrange("acapy_outbound", 0, -1) == []


@pytest.mark.asyncio
Expand Down Expand Up @@ -145,5 +145,5 @@ async def test_deliverer_retry_on_failure(
time.sleep(1)
msg_received = True

assert "test-failed-msg" in (msg['content']
for msg in faber.retrieve_basicmessages()['results'])
# assert "test-failed-msg" in (msg['content']
# for msg in faber.retrieve_basicmessages()['results'])
1 change: 1 addition & 0 deletions redis_events/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,5 @@ output = "test-reports/coverage.xml"

[build-system]
requires = ["setuptools", "poetry-core>=1.2"]
build-backend = "poetry.core.masonry.api"

2 changes: 1 addition & 1 deletion repo_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def combine_dependenices(plugin_dependencies, global_dependencies) -> None:
def get_section(i: int, filedata: list, arr: list) -> int:
"""Put the section into the array and return the number of lines in the section."""
j = i
while j < len(filedata) - 1 and not is_blank_line(filedata[j]):
while j < len(filedata) and not is_blank_line(filedata[j]):
arr.append(filedata[j])
j += 1
return j - i
Expand Down

0 comments on commit 220d71c

Please sign in to comment.