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

Tests failing with *** should be the URI without the password #744

Closed
bobfang opened this issue May 2, 2023 · 1 comment · Fixed by #748
Closed

Tests failing with *** should be the URI without the password #744

bobfang opened this issue May 2, 2023 · 1 comment · Fixed by #748
Assignees
Labels

Comments

@bobfang
Copy link

bobfang commented May 2, 2023

I'm seeing only these tests fail when building Sqitch 1.3.1 and Sqitch 1.3.0. In the past I've built these images without any issues, are there some dependencies that have been updated recently and changed the behavior of how URI passwords are handled?

#   at t/mysql.t line 138.
#          got: 'db:mysql://me@foo.com/widgets'
#     expected: 'db:mysql://me:@foo.com/widgets'
#   Failed test 'destination should be the URI without the password'
#   at t/mysql.t line 140.
#          got: 'db:mysql://me@foo.com/widgets'
#     expected: 'db:mysql://me:@foo.com/widgets'
#   Failed test 'registry_destination should be the sqitch DB URL without the password'
#   at t/mysql.t line 145.
#          got: 'db:mysql://me@foo.com/meta'
#     expected: 'db:mysql://me:@foo.com/meta'
# Looks like you failed 3 tests of 140.
t/mysql.t ........... 
Dubious, test returned 3 (wstat 768, 0x300)
Failed 3/140 subtests 
	(less 1 skipped subtest: 136 okay)`

#   Failed test 'Destination should omit password'
#   at t/snowflake.t line 325.
#          got: 'db:snowflake://fred@foo.snowflakecomputing.com/try?warehouse=foo;role=yup'
#     expected: 'db:snowflake://fred:@foo.snowflakecomputing.com/try?warehouse=foo;role=yup'
# Looks like you failed 1 test of 130.
t/snowflake.t ....... 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/130 subtests 
	(less 1 skipped subtest: 128 okay)
#   Failed test 'Registry target should be configured registry_uri without password'
#   at t/sqlite.t line 160.
#          got: 'db:sqlite://x@/path/to/registry.db'
#     expected: 'db:sqlite://x:@/path/to/registry.db'
# Looks like you failed 1 test of 128.
t/sqlite.t .......... 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/128 subtests 
	(less 8 skipped subtests: 119 okay)

Here's my docker file:

ARG VERSION=1.3.1
WORKDIR /work
RUN mkdir -p /usr/share/man/man1 /usr/share/man/man7 \
    && microdnf install -y unixODBC-devel postgresql-devel \
    && curl -LO https://www.cpan.org/authors/id/D/DW/DWHEELER/App-Sqitch-v$VERSION.tar.gz \
    && mkdir src \
    && tar -zxf App-Sqitch-v$VERSION.tar.gz --strip-components 1 -C src

# Install cpan and build dependencies.
ENV PERL5LIB /work/local/lib/perl5
RUN curl -sL --compressed https://git.io/cpm > cpm && chmod +x cpm \
    && ./cpm install -L local --verbose --no-test --show-build-log-on-failure ExtUtils::MakeMaker \
    && ./cpm install -L local --verbose --no-test --show-build-log-on-failure --with-recommends \
        --with-configure --cpanfile src/dist/cpanfile
#Build, test, bundle, prune.
WORKDIR /work/src

RUN perl Build.PL --quiet --install_base /app --etcdir /etc/sqitch \
    --config installman1dir= --config installsiteman1dir= --config installman3dir= --config installsiteman3dir= \
    --with postgres --with odbc \
    && ./Build test && ./Build bundle \
    && rm -rf /app/man \
    && find /app -name '*.pod' | grep -v sqitch | xargs rm -rf
@theory
Copy link
Collaborator

theory commented May 2, 2023

This is because libwww-perl/URI#13 was fixed this week (after almost 10 years!). Will have to modify the tests to allow the : to be optional.

@theory theory self-assigned this May 2, 2023
@theory theory added the bug label May 2, 2023
theory added a commit that referenced this issue May 10, 2023
When there is a username but no password, URI used to leave an orphan
colon in the URI (reported in libwww-perl/URI#13). That bug was fixed in
libwww-perl/URI#31, leading to failures in Sqitch tests expecting the
colon to be present.

So change the tests to use a regular expression to match such URIs, so
that the presence of the colon is optional. Resolves #744.
theory added a commit that referenced this issue May 10, 2023
When there is a username but no password, URI used to leave an orphan
colon in the URI (reported in libwww-perl/URI#13). That bug was fixed in
libwww-perl/URI#31, leading to failures in Sqitch tests expecting the
colon to be present.

libwww-perl/URI-db#23 also changed the DSN of URI::Oracle to specify the
database name with `service_name=`.

So change the tests to use regular expressions to match such URIs and
DSNs, so that the presence of the colon or service name is optional.
Resolves #744.
theory added a commit that referenced this issue May 10, 2023
When there is a username but no password, URI used to leave an orphan
colon in the URI (reported in libwww-perl/URI#13). That bug was fixed in
libwww-perl/URI#31, leading to failures in Sqitch tests expecting the
colon to be present.

libwww-perl/URI-db#23 also changed the DSN of URI::Oracle to specify the
database name with `service_name=`.

So change the tests to use regular expressions to match such URIs and
DSNs, so that the presence of the colon or service name is optional.
Resolves #744.
theory added a commit that referenced this issue May 10, 2023
When there is a username but no password, URI used to leave an orphan
colon in the URI (reported in libwww-perl/URI#13). That bug was fixed in
libwww-perl/URI#31, leading to failures in Sqitch tests expecting the
colon to be present.

libwww-perl/URI-db#23 also changed the DSN of URI::Oracle to specify the
database name with `service_name=`.

So change the tests to use regular expressions to match such URIs and
DSNs, so that the presence of the colon or service name is optional.
Resolves #744.
@theory theory closed this as completed in bcf0250 May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants