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 CI build errors on Windows #4082

Merged
merged 2 commits into from Nov 27, 2018
Merged

Fix CI build errors on Windows #4082

merged 2 commits into from Nov 27, 2018

Conversation

bajtos
Copy link
Member

@bajtos bajtos commented Nov 26, 2018

Description

Our tests seem to be failing on Windows, see #4079

<testcase classname="User Verification user.verify(options, fn)" 
  name="Verify a user&#x27;s email address with custom token generator" time="0"
><failure>0 == true
AssertionError: 0 == true
    at test\user.test.js:1523:13
    at common\models\user.js:150:273
    at Nodemailer.&#x3C;anonymous&#x3E; (node_modules\nodemailer\lib\nodemailer.js:329:26)
    at StubTransport.&#x3C;anonymous&#x3E; (node_modules\nodemailer-stub-transport\src\stub-transport.js:78:13)
    at Immediate._onImmediate (node_modules\async-listener\glue.js:188:31)</failure></testcase>
  1. Improve the failing test to report a more helpful error message.
  2. Fix the test to use a shorter URL not triggering a line break in unexpected place.

Checklist

  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style
    guide

@bajtos bajtos self-assigned this Nov 26, 2018
@bajtos
Copy link
Member Author

bajtos commented Nov 26, 2018

The failing test is not parsing multipart form data and thus chocking when a long line is split using quoted encoding. See the example payload below and notice that the token value is split across multiple lines.

Content-Type: multipart/alternative;
 boundary="----sinikael-?=_1-15432272547430.45698953489772975"
From: noreply@myapp.org
To: bar@bat.com
Subject: Thanks for Registering
Message-ID: <fc9ed03d-5b0a-52a1-3c8c-b698bfc171a2@myapp.org>
X-Mailer: nodemailer (2.7.2; +https://nodemailer.com/; Stub/1.1.0)
Date: Mon, 26 Nov 2018 10:14:14 +0000
MIME-Version: 1.0

------sinikael-?=_1-15432272547430.45698953489772975
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Please verify your email by opening this link in a web browser:
        http://127.0.0.1:63920:3000/api/test-users/confirm?=
uid=3D06c4bb20-f164-11e8-83ba-2f6bdb5357cf&redirect=3D%2F&token=3Dtoken-123=
456
------sinikael-?=_1-15432272547430.45698953489772975
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

<h1>Thank You</h1>

<p>
  Thanks for registering. Please follow the link below to complete your =
registration.
</p>

<p>
  <a href=3D"http://127.0.0.1:63920:3000/api/test-users/confirm?=
uid=3D06c4bb20-f164-11e8-83ba-2f6bdb5357cf&amp;redirect=3D%2F&amp;token=3Dt=
oken-123456">http://127.0.0.1:63920:3000/api/test-users/confirm?=
uid=3D06c4bb20-f164-11e8-83ba-2f6bdb5357cf&amp;redirect=3D%2F&amp;token=3Dt=
oken-123456</a>
</p>
------sinikael-?=_1-15432272547430.45698953489772975--

@bajtos
Copy link
Member Author

bajtos commented Nov 26, 2018

@slnode test please

@bajtos
Copy link
Member Author

bajtos commented Nov 26, 2018

The CI is failing for an unrelated reason now :(

Wiping out workspace first.
java.nio.file.FileSystemException: D:\workspace\loopback\68dfec3a\xunit.xml: The process cannot access the file because it is being used by another process.

@rmg could you please help?

@rmg
Copy link
Member

rmg commented Nov 26, 2018

@slnode test please

@bajtos I took a look and it appears that some of the tests might be leaving orphaned node processes running after the build finishes. I manually killed them and then cleared the loopback workspaces on that host to get things going again, but this might happen again.

@bajtos
Copy link
Member Author

bajtos commented Nov 27, 2018

I took a look and it appears that some of the tests might be leaving orphaned node processes running after the build finishes. I manually killed them and then cleared the loopback workspaces on that host to get things going again, but this might happen again.

Thank you for fixing the CI. I remember we have been encountering this problem in the past, I guess there isn't much we can do about it :(

@bajtos
Copy link
Member Author

bajtos commented Nov 27, 2018

The build passed on Windows, I am going to go ahead & land this fix.

@bajtos bajtos merged commit e513019 into 2.x Nov 27, 2018
@bajtos bajtos deleted the fix/windows-ci branch November 27, 2018 07:47
@bajtos bajtos changed the title [WIP] Fix CI build errors on Windows Fix CI build errors on Windows Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants