-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
getTestCasesFromFilesystem seems to be inaccessible #1489
Comments
I've consolidated the needed code, although it's still tied to an old version of gherkin. |
Hi @binarymist, this area has been refactored, the loading of features from the file system is now handled by the Gherkin library. Could you expand a little on your use case - e.g. is it some reporting you want to do as part of the run? There'll be a way, just want to understand your requirement. |
Hi @davidjgoss... Thanks for you response. Yeah, so at this stage we (the back-end) send back the test plan (the concatenated feature file contents that comply with the tags) to the purpleteam CLI that will run, the plan is printed to screen. Does that make sense and is it enough information? Basically the The consuming code is here. |
Hi @davidjgoss ... Any update? Would love to be able to close this (https://gitlab.com/purpleteam-labs/purpleteam/-/issues/25) issue. |
@binarymist is there anything preventing you from using the |
HI @aslakhellesoy and thanks for your response. I only just read this, didn't get any notification. Let me investigate your response, I've added it to our backlog to do and report back. Thanks. |
Hi @aslakhellesoy . Looking at the README, it's unclear if @cucumber/gherkin provides the same functionality that was removed? The Usage example has an options object but it doesn't appear to be used? How do consumers of Thanks. |
Does the new: |
Hi @binarymist As far as I can tell, the The To me it sounds like that should be a simple replacement. BTW, you're using a deprecated version of |
Thanks for your response @aslakhellesoy ! I had high hopes for your response, but...
I tried both @cucumber/gherkin and the supposedly deprecated gherkin packages with the same result. So I:
Also I'm assuming the README.md Usage is incorrect in it's require statement?
and then use some function other than the non-existent Looks like @mikesalvia also had trouble finding it. This led me to your PR which after going through those changes just added more confusion, as these changes don't appear to be to the gherkin-javascript repo which we're supposed to be now using. The gherkin-javascript repo also appears to be missing a CHANGELOG, so I'm finding it difficult to work out how to access the
Yes, I've mentioned this here, although looking at the public package details now... there is no deprecation notice. Can you explain what's happening? I'm also confused as to why the so called deprecated gherkin package refers to the same repository as the non deprecated @cucumber/gherkin package? I thought possibly they were being deployed from different branches, but in looking through the branches, I didn't see any obvious deployment branches. Can you also please shed some light on this? So how exactly does one go about accessing this Thanks. |
Sorry this is so hard to find. It moved to You should be able to use it like this: import GherkinStreams from '@cucumber/gherkin/dist/src/stream/GherkinStreams'
import { IdGenerator } from '@cucumber/messages'
const gherkinOptions = {
defaultDialect: 'en',
newId: IdGenerator.uuid(),
}
const gherkinEnvelopeStream = GherkinStreams.fromPaths(paths, gherkinOptions)
We're maintaining multiple language versions of gherkin, and the changelog is here.
We moved all libraries to the
We're maintaining a lot of multi-platform libraries in the cucumber/cucumber monorepo, and the location of the source code didn't change when we started releasing modules under the |
There is no package by the name of @cucumber/gherkin-streams publicly available in NPM. The closest is @cucumber/gherkin which leads to repo: https://github.com/cucumber/gherkin-javascript which we've alredy been through and not found The only other place that looks like it may be is @cucumber/gherkin-utils or @cucumber/cucumber which both lead to the same repository https://github.com/cucumber/cucumber In looking at the CHANGELOG.md it appears to be unreleased rather than in version 17.0.0? Apon cloning of https://github.com/cucumber/cucumber-js I get a directory gherkin-streams which doesn't show in the github repository. Turns out So I then npm install @cucumber/gherkin latest version (17.0.2) rather than 7.0.0-rc.0 and lo and behold, Am I correct in guessing that So I can get the sources, pickles and gherkinDocuments but I don't see a way to filter the sources on The pickleFilter contains the details of my configured cucumber CLI.
Yes... filtered by the pickleFilter which in my case lists the active tags
I've worked out how to do the replecement, but it still appears as though the same functionality can not be replicated with Have I missed some vital piece of the puzzle? There doesn't seem to be any association in the cucumber messsages between what |
Almost there I think, I'll update this once coded and tested |
Hi @aslakhellesoy. Can you please answer the outstanding questions from here, specifically: Am I correct in guessing that fromPaths will soon be turning up in a new NPM package called @cucumber/gherkin-streams when the next version 17.0.3 of @cucumber/gherkin is released/published? I've done the code changes, but I'm still struggling with:
As I mentioned here: I've worked out how to do the replecement, but it still appears as though the same functionality can not be replicated with I've written some tests and some additional scenarios that should pass. The tests fail due to removed functionality (The algorithm from the removed Where is the code/algorithm that used to be used to do the filtering of the feature file URIs based on the tag expressions... Now that Thanks. |
I faced this issue some days ago and I replaced with 'parseGherkinMessageStream'
|
Thanks @yopasa94 . A few questions from your implementation if you would be so kind? I assume the What are the following properties being passed as the object arguement to
|
Any feedback @yopasa94 I searched your github and the internet but was unable to find your code? |
As you have noticed, there have been a major refactoring of the internals of cucumber in the past few month. This is not a transparent refactoring: the new API relies on messages. @binarymist it would be easier for us to help with your issue with more explanation regarding your problem. Could you please give us a concise summary of what you are facing, and a minimal reproducible example? |
There has been a lot of water under this bridge since I first posted this issue, so being concise may be difficult. I'll do my best though. RephrasingAs per my very first message in this issue on 2 Dec 2020, What did I and others need it to do?For us (purpleteam-labs) the main file involved (now and when it was doing what we needed it to do (last year)) in the Cucumber invocations is /src/api/app/models/app.js of the app-scanner. In the past We needed it to We provide the paths to our feature files, actually the cucumber Cli did and still does this. The Simply put, we need the active test cases as a string based on the tags we initialise the Cucumber CLI with. Why? Because users of the system need a test plan, they need to know which feature files are going to be run when they start the test. Where are we now?Currently Currently The names of the tests should explain what they are supposed to do, but currently do not. All you need to do is compare the passing tests with the failing tests to see where the shortfall is. Thoughts, question, commentsSo far I've setup everything as @aslakhellesoy has suggested. Do you recognise anything workable from @yopasa94 solution? Basically what we're doing here is reimplementing functionality that has been removed but needed by myself and others. Hopefully this is sumarised well enough to understand? Thanks. |
Did you explore Also, the suggestion from @yopasa94 was pretty interesting. Did you had the opportunity to take a look? cucumber-js/src/cli/helpers.ts Line 46 in 24ff9dc
You give too many references to your own code base. Please give minimum reproducible snippets here instead. |
Yes. I've just provided a link to it again. Here it is again https://github.com/purpleteam-labs/purpleteam-app-scanner/blob/06c5148c9f080388164a74ccf990e8ae18f7316f/src/api/app/models/app.js#L160. This is what's under test.
Yes I thought so to, but sadly who knows where it is, and there are still unanswerd questions needed to take it further. Where is it? My comments on it here, here and here.
I thought it might be, as I mentioned here. @aurelien-reeves: Are you actually reading my comments, as you keep asking questions I've already answerd?
Ok, I can do this, but all I'll be doing is copy, pasting what I've already linked to. Then if you want to run it, you'll have to do even more work than simply clone the repo, Thanks. |
I missed that one. But yes, I do read your responses. You keep posting links to your code base. I won't go there. There is too many code. I won't take the time to understand how all your code base works. Also I don't ask for you to copy paste your code here. I ask you for a minimal reproducible example of your issues / what you want to accomplish. I do my best do keep helping you. Please try to simplify as much as possible your questions. |
|
Suggestion: purpleteam-labs/purpleteam-app-scanner_cucumber-1489-repro#1 All test are passing now |
Thanks for that @aurelien-reeves. This appears to asume that the
Is this assumption true? If so great, it's so simple. I also didn't know about the |
Just looked into |
Big thanks @aurelien-reeves for getting this over the line! |
I've posted a message on the Slack, @Raymond also posted there on Feb 29.
I've searched for related issues and found #1220 which is how I used to do it.
I've just upgraded from 5.1.0 to 7.0.0-rc.0, I've read the Changelog. It appears that there is no longer a way to access
cucumber.getTestCasesFromFilesystem
, although the routine that does the work still appears to be in dist/cucumber.js.Is there a new approach for getting the test cases from filesystem that makes
getTestCasesFromFilesystem
redundant?Thanks.
The text was updated successfully, but these errors were encountered: