Skip to content

Commit 877ec80

Browse files
authored
Implement Gherkin scenarios for UUID and UUri serialization
The unit tests for verifying UUID and UUri serialization have been refactired into Cucumber based integration tests that implement the corresponding Gherkin based UUID and UUri scenarios from up-spec.
1 parent 6c7c8ec commit 877ec80

File tree

10 files changed

+1348
-193
lines changed

10 files changed

+1348
-193
lines changed

.env.oft-current

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ UP_SPEC_FILE_PATTERNS="up-spec/*.adoc up-spec/*.md up-spec/basics up-spec/up-l1/
1717

1818
# The file patterns that specify this component's resources which contain specification items
1919
# that cover the requirements
20-
COMPONENT_FILE_PATTERNS="*.adoc *.md *.rs .github examples src tests tools"
20+
COMPONENT_FILE_PATTERNS="*.adoc *.md *.rs *.feature .github examples src tests tools"
2121

2222
OFT_FILE_PATTERNS="$UP_SPEC_FILE_PATTERNS $COMPONENT_FILE_PATTERNS"
2323
OFT_TAGS="_,LanguageLibrary"

.env.oft-latest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ UP_SPEC_FILE_PATTERNS="up-spec/*.adoc up-spec/*.md up-spec/basics up-spec/up-l1/
1717

1818
# The file patterns that specify this component's resources which contain specification items
1919
# that cover the requirements
20-
COMPONENT_FILE_PATTERNS="*.adoc *.md *.rs .github examples src tests tools"
20+
COMPONENT_FILE_PATTERNS="*.adoc *.md *.rs *.feature .github examples src tests tools"
2121

2222
OFT_FILE_PATTERNS="$UP_SPEC_FILE_PATTERNS $COMPONENT_FILE_PATTERNS"
2323
OFT_TAGS="_,LanguageLibrary"

.github/workflows/check.yaml

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ on:
2222
- main
2323
pull_request:
2424
paths:
25+
- "examples/**"
2526
- "src/**"
27+
- "tests/**"
2628
- "Cargo.*"
2729
- "build.rs"
2830
- "deny.toml"
@@ -134,13 +136,11 @@ jobs:
134136
cargo hack check --feature-powerset --no-dev-deps
135137
136138
# [impl->req~up-language-ci-test~1]
137-
nextest:
139+
test:
138140
# Subset of feature-combos, on only one OS - more complete testing in test-featurematrix.yaml
139141
outputs:
140142
test_results_url: ${{ steps.test_results.outputs.artifact-url }}
141143
runs-on: ubuntu-latest
142-
env:
143-
NEXTEST_EXPERIMENTAL_LIBTEST_JSON: 1
144144
strategy:
145145
matrix:
146146
feature-flags: ["", "--no-default-features", "--all-features"]
@@ -151,28 +151,24 @@ jobs:
151151
- uses: dtolnay/rust-toolchain@master
152152
with:
153153
toolchain: ${{ env.RUST_TOOLCHAIN }}
154-
- uses: Swatinem/rust-cache@v2
155-
# install tool to convert cargo's JSON test output to JUNIT format
156-
- run: |
157-
cargo install cargo2junit
158-
# Using nextest because it's faster than built-in test
159-
- uses: taiki-e/install-action@nextest
160-
- name: Run cargo nextest
154+
155+
- name: Run lib tests
156+
run: |
157+
mkdir -p ${GITHUB_WORKSPACE}/target
158+
RUSTC_BOOTSTRAP=1 cargo test --no-fail-fast --lib ${{ matrix.feature-flags }} -- -Z unstable-options --format junit --report-time > ${GITHUB_WORKSPACE}/target/lib-test-results.xml
159+
- name: Run doc tests
161160
run: |
162-
cargo nextest run ${{ matrix.feature-flags }} --profile ci
163-
- name: Run doctests
161+
RUSTC_BOOTSTRAP=1 cargo test --no-fail-fast --doc ${{ matrix.feature-flags }} -- -Z unstable-options --format junit --report-time > ${GITHUB_WORKSPACE}/target/doc-test-results.xml
162+
- name: Run TCK tests
164163
run: |
165-
# we use tee to let cargo test print to the console
166-
RUSTC_BOOTSTRAP=1 cargo test --doc ${{ matrix.feature-flags }} -- -Z unstable-options --format json --report-time | tee target/doctest-results.json
167-
# write output to same directory as the one used by cargo nextest in order
168-
# to flatten the directory hierarchy when uploading the test results
169-
cat target/doctest-results.json | cargo2junit > target/nextest/ci/doctest-results.xml
164+
# the Cucumber based tests write a results file in JUnit format to "tck-[test_name]-results.xml"
165+
cargo test --no-fail-fast --test 'tck_*' ${{ matrix.feature-flags }} -- --junit-out-folder=${GITHUB_WORKSPACE}/target
170166
171167
- name: Upload all-features test results artifact
172168
id: test_results
173169
if: matrix.feature-flags == '--all-features'
174170
uses: actions/upload-artifact@v4
175171
with:
176172
name: test-results
177-
# this will include the nextest and doctest result files in the archive's root folder
178-
path: target/nextest/ci/*-results.xml
173+
# include all test result files
174+
path: target/*-results.xml

0 commit comments

Comments
 (0)