Skip to content

tests: fix hardcoded skip in test_import_from_url#3414

Open
Yashasm18 wants to merge 1 commit into
docker:mainfrom
Yashasm18:fix/test-import-from-url-skip-condition
Open

tests: fix hardcoded skip in test_import_from_url#3414
Yashasm18 wants to merge 1 commit into
docker:mainfrom
Yashasm18:fix/test-import-from-url-skip-condition

Conversation

@Yashasm18

Copy link
Copy Markdown

Replace skipif(True, ...) with a runtime check that detects whether tests are running inside a Docker container by checking for /.dockerenv. This allows the test to run normally outside containers while still skipping inside them where the temporary HTTP server is unreachable.

Relates to moby/moby#52754

Replace skipif(True, ...) with a runtime check that detects
whether tests are running inside a Docker container by
checking for /.dockerenv. This allows the test to run
normally outside containers while still skipping inside them
where the temporary HTTP server is unreachable.

Relates to moby/moby#52754

Signed-off-by: YASHAS <sssyashu850@gmail.com>
@Yashasm18 Yashasm18 force-pushed the fix/test-import-from-url-skip-condition branch from b8a1ed0 to 9026445 Compare July 8, 2026 12:31
Comment on lines -281 to +285
@pytest.mark.skipif(True, reason="Doesn't work inside a container - FIXME")
@pytest.mark.skipif(
os.environ.get('DOCKER_HOST', '').startswith('unix:///') and
os.path.exists('/.dockerenv'),
reason="Doesn't work inside a container - HTTP server unreachable from within Docker"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I see this skip was originally added in 6c0f718

That PR added various similar skips ("Doesn't work inside a container - FIXME"), but a quick search shows that all of those skips were removed except for this one.

Do we know why this one doesn't work inside a container? And perhaps should we check if that's still the case, or if the Skip could be removed?

If it can't be removed, it would be good to leave a comment that describes why it doesn't work (so that potentially it could be fixed if it's not easy to fix short term)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants