Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(regression-tests): correct path for acl files #1829

Merged
merged 1 commit into from
Sep 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 8 additions & 22 deletions tests/dragonfly/acl_family_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,21 +229,12 @@ async def test_acl_with_long_running_script(df_server):
await admin_client.close()


SCRIPTS_DIR = os.path.dirname(os.path.abspath(__file__))


@pytest.mark.asyncio
@dfly_args(
{
"aclfile": os.environ.get(
"DRAGONFLY_PATH/wrong.acl", os.path.join(SCRIPTS_DIR, "../../build-dbg/wrong.acl")
),
"port": 1111,
}
)
@dfly_args({"port": 1111})
async def test_bad_acl_file(df_local_factory):
scripts_dir = os.path.dirname(os.path.abspath(__file__))
df = df_local_factory.create()
path = df_local_factory.params.path
acl = os.path.join(os.path.dirname(path), "wrong.acl")
df = df_local_factory.create(aclfile=acl)

df.start()

Expand All @@ -256,16 +247,11 @@ async def test_bad_acl_file(df_local_factory):


@pytest.mark.asyncio
@dfly_args(
{
"aclfile": os.environ.get(
"DRAGONFLY_PATH/ok.acl", os.path.join(SCRIPTS_DIR, "../../build-dbg/ok.acl")
),
"port": 1111,
}
)
@dfly_args({"port": 1111})
async def test_good_acl_file(df_local_factory):
df = df_local_factory.create()
path = df_local_factory.params.path
acl = os.path.join(os.path.dirname(path), "ok.acl")
df = df_local_factory.create(aclfile=acl)
Comment on lines 249 to +254
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See how easier it would've been to place them just locally 😝

And now you use @dfly_args with a random port to move the default instance out of the way

Copy link
Contributor Author

@kostasrim kostasrim Sep 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See how easier it would've been to place them just locally

That's exactly what you suggested 🤣

And now you use @dfly_args with a random port to move the default instance out of the way

I will patch this on the next PR, I will make changes anyway so I didn;t bother


df.start()
client = aioredis.Redis(port=df.port)
Expand Down