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

CI: Ensure browser tests are up-to-date #5396

Merged
merged 2 commits into from
Jan 25, 2022
Merged

Conversation

edemaine
Copy link
Contributor

Today I learned about the cake rule doc:test which builds the browser tests from the main tests (similar to build:browser but for the tests). This PR ensures that those tests are up-to-date before CI can succeed, similar to the other build operations we do.

As a side note, I find the name doc:test rather confusing, as it's about building tests not documenting or running them. But that's less important.

Today I learned about the cake rule `doc:test` which builds the browser tests from the main tests (similar to `build:browser` but for the tests). This PR ensures that those tests are up-to-date before CI can succeed, similar to the other build operations we do.

As a side note, I find the name `doc:test` rather confusing, as it's about building tests not documenting or running them. But that's less important.
@GeoffreyBooth
Copy link
Collaborator

I think you also need to update the output in order to get this PR’s CI to pass. cake release is the one that updates everything.

@@ -310,7 +310,7 @@ buildDocTests = (watch = no) ->
# Helpers
testsInScriptBlocks = ->
output = ''
for filename in fs.readdirSync testsSourceFolder
for filename in fs.readdirSync(testsSourceFolder).sort()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why this change?

@edemaine
Copy link
Contributor Author

edemaine commented Jan 25, 2022

It turns out the issue wasn't that the output wasn't updated, it's that the order that the tests were combined was inconsistent, dependent on the filesystem. Sorting the directory seems to produce the original results; tests now pass. I'm guessing that some file systems automatically sort listdir, but Windows didn't, and apparently CI (ubuntu I think?) didn't.

@GeoffreyBooth
Copy link
Collaborator

the order that the tests were combined was inconsistent

Why does it matter? Do some tests depend on others?

@GeoffreyBooth GeoffreyBooth merged commit 6fd58ef into jashkenas:main Jan 25, 2022
@edemaine
Copy link
Contributor Author

The cake doc:test script concatenates a bunch of files into one file. If the file order is inconsistent, so are the results. The result needs to be consistent for CI to check that it was built properly. (It will also make for smaller diffs, if they get built on a nonalphabetical file system.)

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.

2 participants