-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat(test-data-generator): Output required Test Interface Actions #657
Conversation
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.
I think this was just accidentally included in git
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.
(auto-generated file) Changed to feature-requirements.json (which also now has TI actions)
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.
Auto-generated file
@@ -15,7 +15,7 @@ const { FeatureJsonSchema } = require('./featureJson.js'); | |||
|
|||
const FEATURES_ROOT = path.join(__dirname, '..', 'test', 'features'); | |||
const INDEX_README_FILE = path.join(FEATURES_ROOT, 'README.md'); | |||
const INDEX_CRITERIA_REQUIREMENTS_JSON_FILE = path.join(FEATURES_ROOT, 'criteria-requirements.json'); | |||
const INDEX_FEATURE_REQUIREMENTS_JSON_FILE = path.join(FEATURES_ROOT, 'feature-requirements.json'); |
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.
Renamed because it now contains more info. But this new info (required TI Actions) is still per-feature. So, feature-requirements
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.
If the reviewer is not aware, Test Data Generator gets its metadata from this file which is generated during automatic documentation generation (which has access to each test's describeFeature(..) metadata)
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.
Appreciate the rename very much!
@@ -13,10 +19,12 @@ npm run test-data-generator # all active features specified in the current confi | |||
|
|||
npm run test-data-generator -- common-error-conditions # only enough data for the common-error-conditions feature | |||
|
|||
npm run test-data-generator -- --output ./test-data.json # output to ./test-data.json | |||
npm run test-data-generator -- --output-dir ../../../test-data-generator-output # output to ../../../test-data-generator-output |
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.
--output-dir
seems a bit simpler to maintain when we're now dealing with multiple output files and I expect sufficiently customizable for most purposes? Please correct me if I'm wrong!
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.
Yep makes sense
! There is a sort-of bug here, which is that | ||
test:SellerAcceptOrderProposalSimulateAction will be outputted even if Test | ||
Data Generator has been called on a category or feature that doesn't include | ||
successful bookings. This is technically incorrect. In the opinion of this | ||
author, it's fine because every Booking System should be able to support | ||
successful bookings (!) */ |
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.
of note
…enerator-ti-actions
Closes #656
Previously, test-data-generator generated one file,
test-data/test-data.json
, which listed the criteria of Opportunities that were required for testing.Now, it generates two files:
output/opportunity-test-data.json
: Same as the old oneoutput/test-interface-actions.json
: Has TI ActionsI'll include some examples of the latter in the QA part.
The reason that I introduced TI Actions into a new file, rather than bringing them into the same file is because the original file has a very specific schema.org-style design. There's no where for TI Actions to be included – reasonable as it's really just a completely different style of data. So, instead there's a new file. It also uses the
ItemList
type, but each item, is just a TI Action type, with only@id
, e.g.{ "@type": "test:AccessChannelUpdateSimulateAction" }
QA
npm run test-data-generator
(against default.json i.e. almost every feature):npm run test-data-generator -- common-error-conditions
(a minimal example)Note: in theory, that one shouldn't have any actions in it at all. Accept Order Proposal action being in there is a kind of hack, explained in a code comment
npm run test-data-generator -- access-channel-update-notifications
NODE_ENV=dev npm run test-data-generator
, where I changed dev.json to be: required features only, except for Seller Requested Cancellation (w & w/o message) and Seller Requested Replacement; simple flow only: