Skip to content

compatibility-kit: [Doc] Usage of CCK and fake-cucumber #1400

@bbros-dev

Description

@bbros-dev

Summary

It is necessary to use the Cucumber-Compatibility-Kit (CCK) to track, and document, the status of a new Cucumber/Gherkin implementation, or to update the status of an existing Cucumber implementation.

However, the documentation is cryptic, and there is no working example(s) of building a CCK report. Naming the golden-source/definitive source fake-cucumber did not reduce confusion.

Expected Behavior

Documentation that when followed leaves:

  • Updated testdata generated by golden-master (fake-cucumber?)
  • Updated CCK report and artifacts.

Current Behavior

No effective documentation.

Possible Solution

To update the status of Cucumber-<Lang> compared to golden-master (fake-cucumber):

  • Requirements:
    • Install node.js >15.0 or from NodeSource
    • Install npm
    • git clone https://github.com/cucumber/cucumber ~/src/cucumber
    • git clone https://github.com/bbqsrc/gherkin-rust ~/src/cucumber-rust
pushd ~/src/cucumber/fake-cucumber
  npm install -g fake-cucumber
popd
pushd ~/src/cucumber/compatibility-kit
  make clean
  make
popd

At this point we get a multitude of errors:

error TS2307: Cannot find module '@cucumber/fake-cucumber' or its corresponding type declarations.

We aren't node gurus - and don't want to be - so we hacked around this trying to install fake-cucmber various ways, and eventually by removing '@cucumber/ from import statements.

That then left us with 6 errors:

$ make
if [[ -d javascript ]]; then cd javascript && make default; fimake[1]: Entering directory '/home/<user>/src/cucumber/compatibility-kit/javascript'npm run build                                                          
                                                                            
> @cucumber/[email protected] build
> tsc                                                                                                                            
features/attachments/attachments.ts:6:1 - error TS2554: Expected 2 arguments, but got 1.
                                                      
6 Before(() => undefined)      
  ~~~~~~~~~~~~~~~~~~~~~~~

  node_modules/fake-cucumber/dist/src/SupportCode.d.ts:6:53
    6 declare type RegisterHook = (tagExpression: string, body: AnyBody) => void;
                                                          ~~~~~~~~~~~~~
    An argument for 'body' was not provided.
                                                                                  
features/attachments/attachments.ts:6:8 - error TS7011: Function expression, which lacks retu
rn-type annotation, implicitly has an 'any' return type.
                                                      
6 Before(() => undefined)

features/data-tables/data-tables.ts:3:23 - error TS2307: Cannot find module 'fake-cucumber/di
st/src/DataTable' or its corresponding type declarations.

3 import DataTable from 'fake-cucumber/dist/src/DataTable'
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

features/hooks/hooks.ts:3:1 - error TS2554: Expected 2 arguments, but got 1.

3 Before(function () {
  ~~~~~~~~~~~~~~~~~~~~
4   // no-op
  ~~~~~~~~~~
5 })
  ~~

  node_modules/fake-cucumber/dist/src/SupportCode.d.ts:6:53
    6 declare type RegisterHook = (tagExpression: string, body: AnyBody) => void;
                                                          ~~~~~~~~~~~~~
    An argument for 'body' was not provided.

features/hooks/hooks.ts:15:1 - error TS2554: Expected 2 arguments, but got 1.

15 After(function () {
   ~~~~~~~~~~~~~~~~~~~
16   throw new Error('Exception in hook')
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 17 })
   ~~

  node_modules/fake-cucumber/dist/src/SupportCode.d.ts:6:53
    6 declare type RegisterHook = (tagExpression: string, body: AnyBody) => void;
                                                          ~~~~~~~~~~~~~
    An argument for 'body' was not provided.

features/parameter-types/parameter-types.ts:2:17 - error TS2305: Module '"fake-cucumber"' has
 no exported member 'ParameterType'.

2 import { Given, ParameterType } from 'fake-cucumber'
                  ~~~~~~~~~~~~~


Found 6 errors.

default.mk:25: recipe for target '.built' failed
make[1]: *** [.built] Error 2
make[1]: Leaving directory '/home/<user>/src/cucumber/compatibility-kit/javascript'
default.mk:17: recipe for target 'default-javascript' failed
make: *** [default-javascript] Error 2

which brings us here....

Steps to Reproduce (for bugs)

See above.

Context & Motivation

How has this issue affected you? Blocking progress on validating and document the Cucumber-Rust implementation level of compatibility.

What are you trying to accomplish? Get the Cucumber-Rust implementation to a point where it can be included upstream.

Your Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions