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

Architectural redesign and concurrent execution #128

Merged
merged 87 commits into from
Sep 27, 2021
Merged
Show file tree
Hide file tree
Changes from 84 commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
a5b7f90
Let The Great Redesign begin!
ilslv Jul 23, 2021
c04860e
Return old cucumber_rust_codegen crate
ilslv Jul 23, 2021
9848993
Relax Cucumber trait bounds
ilslv Jul 23, 2021
ea7bb7a
Document writer::Normalized impl
ilslv Jul 23, 2021
8cfbcc2
Fix Rule hash collision and bump rust MSRV
ilslv Jul 23, 2021
77239b2
Remove MSRV test
ilslv Jul 23, 2021
68b83b0
Fix codegen
ilslv Jul 29, 2021
1751a27
Fix CI
ilslv Jul 29, 2021
3141549
Optimize Scenario inserting for better output
ilslv Jul 30, 2021
5b24964
Make runner::Basic max_concurrent_scenarios optional [skip ci]
ilslv Jul 30, 2021
7837d10
Add scenario filtration [skip ci]
ilslv Jul 30, 2021
f19a316
Return Writer from run() [skip ci]
ilslv Jul 30, 2021
dda5b14
Fix lints [skip ci]
ilslv Jul 30, 2021
bb81427
Arc-ify everything [skip ci]
ilslv Jul 30, 2021
42cfcd7
Add Documentation to CI
ilslv Jul 30, 2021
6a2fe4d
Deal with filter in Cucumber instead of Parser
ilslv Aug 3, 2021
6971b41
Add EditorConfig rules
tyranron Aug 12, 2021
8a81538
Corrections to toolchain
tyranron Aug 12, 2021
c586346
Bump up versions
tyranron Aug 12, 2021
d4d0d75
Enable `macros` feature by default
tyranron Aug 12, 2021
b817ddb
Some corrections
tyranron Aug 12, 2021
1d535be
Add EditorConfig rules for .feature files
tyranron Aug 12, 2021
055f82a
Replace #[given(step)], #[when(step)] and #[then(step)] with single #…
ilslv Aug 12, 2021
f53bd14
WIP
ilslv Aug 13, 2021
faf67df
Clarify some stuff in docs
ilslv Aug 13, 2021
9d26f5d
Resolve ScenarioType based on Feature and Rule additionally to Scenar…
ilslv Aug 13, 2021
edb178f
Add CHANGELOG entry
ilslv Aug 13, 2021
59ea8f1
Make Parse fallible
ilslv Aug 13, 2021
2e26b70
Make Parse fallible
ilslv Aug 13, 2021
47d255e
Corrections
ilslv Aug 13, 2021
af1d059
Corrections
tyranron Aug 17, 2021
4bc8d65
Refactor a bit
ilslv Aug 18, 2021
74e786e
Docs
ilslv Aug 18, 2021
67b3f65
Introduce OutputtedWriter to generalize over output (stdout, file, etc.)
ilslv Aug 18, 2021
c8457c9
Even more docs
ilslv Aug 18, 2021
a7c5041
Add README test
ilslv Aug 18, 2021
a434a75
Update book
ilslv Aug 19, 2021
0e8cc2e
Proper book testing and publishing on ci
ilslv Aug 19, 2021
5a3302a
.gitignore
ilslv Aug 19, 2021
eeeea66
.gitignore
ilslv Aug 19, 2021
0b5a308
Small README correction
ilslv Aug 19, 2021
68541b1
Add book to Makefile
ilslv Aug 19, 2021
a908ac2
Some corrections
ilslv Aug 19, 2021
e6ee550
CI corrections
ilslv Aug 19, 2021
48252a9
Refactor writer::Normalized
ilslv Aug 19, 2021
cfafa6f
Book corrections
ilslv Aug 19, 2021
c40ac7d
Remove book artifact from CI
ilslv Aug 19, 2021
d70fc29
Final CI touches
ilslv Aug 19, 2021
845100e
Expand Scenario Outline inside Rules too
ilslv Aug 19, 2021
bdebc39
Upload docs artifacts only on [upload docs]
ilslv Aug 19, 2021
dea5e01
Upload docs artifacts only on [upload docs]
ilslv Aug 19, 2021
d61f706
Add releasing to CI
ilslv Aug 20, 2021
ccee630
Add book link in README
ilslv Aug 20, 2021
766e872
Pretty-print with writer::Basic only if terminal was detected
ilslv Aug 20, 2021
df97432
Fix runner ignoring Rule background
ilslv Aug 20, 2021
27fb1bf
Add tests
ilslv Aug 20, 2021
fc8c6d3
Fix tests
ilslv Aug 20, 2021
67d4153
Fix writer::Basic
ilslv Aug 20, 2021
ddb9971
Fix tests on Windows
ilslv Aug 20, 2021
9d203a5
Fix tests on Windows
ilslv Aug 20, 2021
7533bb5
Add language support for parser::Basic
ilslv Aug 20, 2021
6f5b33f
Refactor Runner trait
tyranron Aug 23, 2021
0a2f867
Some corrections [skip ci]
tyranron Sep 6, 2021
5170124
Add @allow_skipped tag
ilslv Sep 7, 2021
b4d063c
Corrections
ilslv Sep 7, 2021
aaa642a
Change event::Cucumber::ParsingError to parser::Result<event::Cucumber>
ilslv Sep 7, 2021
85d9074
Use `# language: ` comment to get language
ilslv Sep 7, 2021
1556561
Fix regex for windows
ilslv Sep 7, 2021
a3ec36d
Fix regex for windows
ilslv Sep 7, 2021
8db0073
Fix regex for windows
ilslv Sep 7, 2021
4b2e107
Clarify ArbitraryWriter impl for writer::Summarized in docs
ilslv Sep 7, 2021
5070342
Corrections
ilslv Sep 8, 2021
c1a4e23
Fix dependencies
ilslv Sep 8, 2021
184a537
Corrections
tyranron Sep 15, 2021
b86cf10
Corrections
ilslv Sep 15, 2021
0622dce
Corrections
ilslv Sep 15, 2021
1de8483
Merge remote-tracking branch 'origin/initial-redesign' into initial-r…
ilslv Sep 15, 2021
dc0794d
Corrections
ilslv Sep 15, 2021
96e4de9
Corrections [skip ci]
tyranron Sep 15, 2021
a9416e4
Correct deps versions [skip ci]
tyranron Sep 15, 2021
b194f64
Add FailOnSkipped Writer and prettify Summarized output
ilslv Sep 16, 2021
032f68a
Re-record asciinema demonstrations
ilslv Sep 16, 2021
a0e32d5
Correct GIFs [skip ci]
tyranron Sep 17, 2021
d30170c
Corrections
tyranron Sep 17, 2021
a6ccc84
Remove get_language, as parser already handles it
ilslv Sep 20, 2021
17e8d16
Switch back to gherkin::Feature::parse_path()
ilslv Sep 20, 2021
7daae6f
Fix docs
ilslv Sep 20, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
root = true

[*]
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 80

[*.md]
indent_style = space
indent_size = 4
trim_trailing_whitespace = false
max_line_length = off

[*.rs]
indent_style = space
indent_size = 4

[*.feature]
indent_style = space
indent_size = 2

[*.toml]
indent_style = space
indent_size = 4

[*.{yaml,yml}]
indent_style = space
indent_size = 2

[Makefile]
indent_style = tab
indent_size = 4
211 changes: 196 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,214 @@
on: [push, pull_request]

name: CI

on:
push:
branches: ["main"]
tags: ["v*"]
pull_request:
branches: ["main"]

env:
RUST_BACKTRACE: 1

jobs:
build:

##########################
# Linting and formatting #
##########################

clippy:
if: ${{ github.ref == 'refs/heads/main'
|| startsWith(github.ref, 'refs/tags/v')
|| !contains(github.event.head_commit.message, '[skip ci]') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: clippy

- run: make cargo.lint

rustfmt:
if: ${{ github.ref == 'refs/heads/main'
|| startsWith(github.ref, 'refs/tags/v')
|| !contains(github.event.head_commit.message, '[skip ci]') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rustfmt

- run: make cargo.fmt check=yes




###########
# Testing #
###########

test:
if: ${{ github.ref == 'refs/heads/main'
|| startsWith(github.ref, 'refs/tags/v')
|| !contains(github.event.head_commit.message, '[skip ci]') }}
strategy:
fail-fast: false
matrix:
rust:
crate:
- cucumber_rust_codegen
- cucumber_rust
os:
- ubuntu
- macOS
- windows
toolchain:
- stable
- beta
- nightly
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
toolchain: ${{ matrix.toolchain }}
override: true
components: rustfmt, clippy
- uses: actions-rs/cargo@v1

- run: make test.cargo crate=${{ matrix.crate }}

test-book:
if: ${{ github.ref == 'refs/heads/main'
|| startsWith(github.ref, 'refs/tags/v')
|| !contains(github.event.head_commit.message, '[skip ci]') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
command: build
args: --all-features
- uses: actions-rs/cargo@v1
profile: minimal
toolchain: stable

- run: make test.book




#################
# Documentation #
#################

rustdoc:
if: ${{ github.ref == 'refs/heads/main'
|| startsWith(github.ref, 'refs/tags/v')
|| !contains(github.event.head_commit.message, '[skip ci]') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable

- run: make cargo.doc open=no




#############
# Releasing #
#############

release-github:
name: Release on GitHub
needs: ["clippy", "rustfmt", "rustdoc", "test", "test-book"]
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Parse release version
id: release
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v}

- name: Verify release version matches `cucumber_rust_codegen` Cargo manifest
run: >-
test "${{ steps.release.outputs.VERSION }}" \
== "$(grep -m1 'version = "' codegen/Cargo.toml | cut -d '"' -f2)"
- name: Verify release version matches `cucumber_rust` Cargo manifest
run: >-
test "${{ steps.release.outputs.VERSION }}" \
== "$(grep -m1 'version = "' Cargo.toml | cut -d '"' -f2)"

- name: Parse CHANGELOG link
id: changelog
run: echo ::set-output
name=LINK::https://github.com/${{ github.repository }}/blob/v${{ steps.release.outputs.VERSION }}/CHANGELOG.md#$(sed -n '/^### \[${{ steps.release.outputs.VERSION }}\]/{s/^### \[\(.*\)\][^0-9]*\([0-9].*\)/\1--\2/;s/[^0-9a-z-]*//g;p;}' CHANGELOG.md)

- uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: ${{ steps.release.outputs.VERSION }}
body: |
[API docs](https://docs.rs/cucumber_rust/${{ steps.release.outputs.VERSION }})
[Changelog](${{ steps.changelog.outputs.LINK }})
prerelease: ${{ contains(steps.release.outputs.VERSION, '-') }}

release-crate:
name: Release on crates.io
needs: ["release-github"]
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
command: test
args: -p cucumber_rust_codegen
- uses: actions-rs/cargo@v1
profile: minimal
toolchain: stable

- name: Publish `cucumber_rust_codegen` crate
run: cargo publish --token ${{ secrets.CRATESIO_TOKEN }}
working-directory: ./codegen

- name: Wait crates.io index is updated
run: sleep 120

- name: Publish `cucumber_rust` crate
run: cargo publish --token ${{ secrets.CRATESIO_TOKEN }}
working-directory: ./




##########
# Deploy #
##########

deploy-book:
name: Deploy Book
needs: ["test-book"]
if: ${{ github.ref == 'refs/heads/main'
|| startsWith(github.ref, 'refs/tags/v') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: peaceiris/actions-mdbook@v1

- run: make book.build out=gh-pages/main
if: ${{ github.ref == 'refs/heads/main' }}

- run: make book.build out=gh-pages/current
if: ${{ startsWith(github.ref, 'refs/tags/v') }}

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
command: test
args: --all-features
github_token: ${{ secrets.GITHUB_TOKEN }}
keep_files: true
publish_dir: book/gh-pages
13 changes: 6 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/.idea/
/.vscode/launch.json
/*.iml
.DS_Store

/target
/target/
/Cargo.lock
**/*.rs.bk

/target
**/*.rs.bk
Cargo.lock
.idea/
.vscode/launch.json
16 changes: 16 additions & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Project configuration for rustfmt Rust code formatter.
# See full list of configurations at:
# https://github.com/rust-lang/rustfmt/blob/master/Configurations.md

max_width = 80
format_strings = false
imports_granularity = "Crate"

format_code_in_doc_comments = true
format_macro_matchers = true
use_try_shorthand = true

error_on_line_overflow = true
error_on_unformatted = true

unstable_features = true
41 changes: 30 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,72 @@

- `Scenario Outline` is treated the same as `Outline` or `Example` in the parser ([gherkin/#19](https://github.com/bbqsrc/gherkin-rust/issues/19))

### 0.9.0 — 2021-07-19
### [0.10.0] — ???
[0.10.0]: /../../tree/v0.10.0

- **Breaking change** Complete redesign:
- Introduce new abstractions: `Parser`, `Runner`, `Writer`.
- Provide reference implementations for those abstractions.
- Add ability to run `Scenario`s concurrently.
- Update book to reflect redesign.

### [0.9.0] — 2021-07-19
[0.9.0]: /../../tree/v0.9.0

- **Breaking change:** the second parameter in the test callbacks is now a `StepContext` object, which contains the `Step` as a `step` field.
- Feature: Add `before` and `after` lifecycle functions to the Cucumber builder
- This function takes a selector for determining when to run 'before' or 'after', and a callback
- Fix: literal paths to .feature files will now work in the Cucumber builder
- Fix: remove unnecessary internal `Rc<T>` usage.

### 0.8.4 — 2021-02-18
### [0.8.4] — 2021-02-18
[0.8.4]: /../../tree/v0.8.4

- Feature: add `language` argument to Cucumber builder to set default language for all feature files
- Feature: add `--debug` flag to always print stdout and stderr per step

### 0.8.3 — 2021-02-09
### [0.8.3] — 2021-02-09
[0.8.3]: /../../tree/v0.8.3

- Update `t!` macro to support specifying type of world argument in closure

### 0.8.2 — 2021-01-30
### [0.8.2] — 2021-01-30
[0.8.2]: /../../tree/v0.8.2

- Re-export `async_trait::async_trait` and `futures` crate for convenience
- Update examples to use `tokio`

### 0.8.1 — 2021-01-30
### [0.8.1] — 2021-01-30
[0.8.1]: /../../tree/v0.8.1

- Added proper i18n support via gherkin 0.9

### 0.8.0 — 2021-01-18
### [0.8.0] — 2021-01-18
[0.8.0]: /../../tree/v0.8.0

- Fixed filtering of tests by tag ([#67](https://github.com/bbqsrc/cucumber-rust/issues/67))
- Implemented failure reporting ([#91](https://github.com/bbqsrc/cucumber-rust/issues/91))
- Removed unnecessary dependent traits from `World` trait
- Added proc-macro variant (thanks Ilya Solovyiov and Kai Ren)

### 0.7.3 — 2020-09-20
### [0.7.3] — 2020-09-20
[0.7.3]: /../../tree/v0.7.3

- Fix missing mut in t! macro for regexes ([#68](https://github.com/bbqsrc/cucumber-rust/issues/68)) — thanks [@stefanpieck](https://github.com/stefanpieck)!

### 0.7.2 — 2020-09-14
### [0.7.2] — 2020-09-14
[0.7.2]: /../../tree/v0.7.2

- Enforce `UnwindSafe` on async test types

### 0.7.1 — 2020-09-09
### [0.7.1] — 2020-09-09
[0.7.1]: /../../tree/v0.7.1

- Fix issue with `t!` macro for unbraced blocks

### 0.7.0 — 2020-09-07
### [0.7.0] — 2020-09-07
[0.7.0]: /../../tree/v0.7.0

- **Breaking changes**: the macro approach provided in 0.6.x and lower has been entirely removed. It was hard to maintain and limited maintenance of the tests themselves.
- A new builder approach has been implemented.
- Support for asynchronous tests has been implemented — this is runtime agnostic.
- Support for asynchronous tests has been implemented — this is runtime agnostic.
Loading