-
Notifications
You must be signed in to change notification settings - Fork 100
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
test: Add path parsing tests #1155
Conversation
Currently, project version info is passed in via a `versionTag` env variable, which is only specified in the Github workflow environment. Consequently, `project.version` ends up being `null` when run locally. This causes weirdness for tools that expect a valid version number. This change switches the project to use the axion-release plugin, which determines the project version by looking at the git repo's tags. Along with that switch, I've moved the project group and version specification into the root build.gradle allprojects {} such that these values do not need to be specified in each sub-poject. I also did some related clean-up for our jitpack configuration (and Maven repository modules, should we every decide to publish them). I believe our current jitpack config doesn't actually work correctly because we only publish artifacts from the main package, but not core. You can see this in practice when looking at: https://jitpack.io/com/github/MobilityData/gtfs-validator/3.0.1/gtfs-validator-3.0.1.pom Notice how it has a dependency on the `core` module but we don't actually publish it anywhere. If you actually attempt to use our project as a jitpack dependency, it will fail. The change was to also publish the core module and to specify more natural artifact names.
longer needed now that project version is determined within Gradle directly. Also fixup references to shadow jars, since they no longer include the versionTag in the filename (also _cli => -cli).
We can't update this code until the PR actually goes in on the master branch.
The Windows end-to-end workflow currently fails because of the version tag script:
This script is removed in PR #1147 as part of the refactor of version number handling, so let's revisit this PR after PR #1147 is merged, as that PR should resolve the issue. |
Thank you for this contribution! 🍰✨🦄 Information about source corruption0 out of 1248 sources are corrupted. Acceptance test detailsThe changes in this pull request did not trigger any new errors on known GTFS datasets from the MobilityDatabase. |
I also cleaned up some other variables from the docker config that don't seem to be used.
…previous commit.
# Conflicts: # .github/workflows/end_to_end.yml
Thank you for this contribution! 🍰✨🦄 Information about source corruption0 out of 1248 sources are corrupted. Acceptance test detailsThe changes in this pull request did not trigger any new errors on known GTFS datasets from the MobilityDatabase. |
So apparently running the validator JAR file with wildcards like:
...doesn't work on Windows PowerShell. Here's the failed CI run with PowerShell: ...with the error:
I can reproduce this locally on Windows 10 Home w/ PowerShell too. I tried switching to using However, using bash hides the path issue that we saw in #1158 (i.e., the path issue only happens when using PowerShell) and defeats the purpose of having a separately Windows CI task. Here's a successful CI run when it should have failed due to the path handling bug (which I added to this PR to test): @bdferris-v2 Based on your work in PR #1147 do you have ideas for the most elegant way to handle this lack of wildcard expansion on Windows PowerShell? Some options I can think of:
|
First, a meta question: Is there really value in running the entire suite of end-to-end feed tests on both Windows and Linux? I think the general classes of errors we are catching here ("does this feed cause the validator to crash unexpectedly?") will be the same on both platforms. Instead, there's an alternate approach where we have a single specific Windows test with a single feed that's just designed to capture platform quirks of Windows. Unfortunately, even if you buy that argument, I'm not sure how much it actually buys us because we'd still need to duplicate major portions of the job definition for Windows. So on to some alternatives. A few that I can think of:
|
This contribution does not follow the conventions set by the Google Java style guide. Please run the following command line at the root of the project to fix formatting errors: |
This contribution does not follow the conventions set by the Google Java style guide. Please run the following command line at the root of the project to fix formatting errors: |
This contribution does not follow the conventions set by the Google Java style guide. Please run the following command line at the root of the project to fix formatting errors: |
Thanks @bdferris-v2, that's a good point. That got me thinking - given these issues, I think a simple unit test for path parsing is probably the best/simplest approach here that gives us coverage for #1158. I added such a test in e64e234 and removed the end-to-end Windows CI from this PR (we still run tests on Windows CI, though). I intentionally reintroduced the bug from #1158 here in this PR to see how the CI handles it. Hopefully it fails as it should. If that works, I'll remove the bug and hopefully we'll have green lights. Thoughts and feedback are welcome. |
Ok, looks good. With the bug from #1158 still in this PR, the new unit test is failing on Windows as expected: ...but passing on Linux: I just removed the #1158 bug from this PR in 62d434d, so hopefully everything should be green on CI now (I tested it locally on Windows and it works). This PR should be ready for review. |
Looks like the acceptance tests are failing: ...with:
@bdferris-v2 Is this related to the below TODO statement in acceptance_test.yml? steps:
- uses: actions/checkout@v1
with:
ref: master
# We still need to compute the versionTag for the master branch until
# changes in PR #1147 have gone in, at which point we can clean up this
# codepath to match the snapshot.
- name: Prepare version name |
Ah, yes! I had meant to fast-follow on that because of exactly this issue, but got distracted. Let me get a PR in to fix that. |
Awesome, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thank you for this contribution! 🍰✨🦄 Information about source corruption0 out of 1248 sources are corrupted. Acceptance test detailsThe changes in this pull request did not trigger any new errors on known GTFS datasets from the MobilityDatabase. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM too! Thank you @barbeau
Summary:
In PR #1146 we observed that changes were made to the input GTFS file path handling that broke execution (CLI and the GUI) on Windows. However, CI never caught this because currently all end-to-end tests are run only on
ubuntu-latest
.This PR changes the CI configuration to run the smallest end-to-end test onwindows-latest
as well.Given the complexity that's emerged of running end-to-end Windows CI (see below comments), I've changed this PR to add simple unit tests to catch the same issue (#1158).
This should catch future instances of path issues on Windows prior to PR merges.
Expected behavior:
CI should catch changes that break end-to-end functionality on Windows as well as Linux.Unit test should catch path parsing errors
Please make sure these boxes are checked before submitting your pull request - thanks!
gradle test
to make sure you didn't break anything