-
Notifications
You must be signed in to change notification settings - Fork 92
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
feature/sc-123396/implement-execute-command-with-eventdata #692
feature/sc-123396/implement-execute-command-with-eventdata #692
Conversation
de22a2e
to
5c87b7b
Compare
5c87b7b
to
fa201f4
Compare
src/cmd/logic-function.js
Outdated
const logicDataBuffer = await fs.readFile(dataPath); | ||
logicData = logicDataBuffer.toString(); |
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.
You can convert to a string while reading the file
const logicDataBuffer = await fs.readFile(dataPath); | |
logicData = logicDataBuffer.toString(); | |
logicData = await fs.readFile(dataPath, 'utf8'); |
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.
Done over here! 👉 15afd83
event: { | ||
event_data: logicData, | ||
event_name: 'test_event', | ||
device_id: '', | ||
product_id: 0 | ||
}, |
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.
This is too restrictive for CLI testing. We'll definitely want to allow passing device id, product id, event name and event data. We'll also want to be able to pass other types of triggers like scheduled and Ledger change. But for now that's ok.
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 agree. I wanted to put two params: --deviceId
and --productId
in order to make the user can test different devices/products according their needs. I didn't that now given that I wasn't sure the best ui
interaction for asking that info.
Thinking about a prompt or just adding that into a option param
fa201f4
to
1312a53
Compare
Description
This PR will add
logic execute
command in order to execute a logic function and get the logs and resultHow to Test
git pull && git checkout feature/sc-123396/implement-execute-command-with-eventdata
npm i
npm run test:unit
.js
filesOutcome
Related Issues / Discussions
Story details: https://app.shortcut.com/particle/story/123396/implement-execute-command-with-eventdata
Completeness