Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Feature/control test commit#30

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ShMcK merged 2 commits intomasterfromfeature/control-test-commit
Sep 9, 2019
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
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
3 changes: 2 additions & 1 deletionsrc/Channel.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -22,7 +22,8 @@ class Channel implements Channel {
console.log('RECEIVED:',actionType)
switch(actionType){
case'TEST_RUN':
vscode.commands.executeCommand('coderoad.run_test')

vscode.commands.executeCommand('coderoad.run_test',action.payload)
return
case'TUTORIAL_CONFIG':
tutorialConfig(action.payload)
Expand Down
4 changes: 3 additions & 1 deletionsrc/actions/runTest.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,9 +23,10 @@ interface Props {
onSuccess():void
onFail():void
onRun():void
onError():void
}

asyncfunctionrunTest({onSuccess, onFail, onRun}:Props):Promise<void>{
asyncfunctionrunTest({onSuccess, onFail, onRun, onError}:Props):Promise<void>{
// increment process id
constprocessId=++currentId

Expand DownExpand Up@@ -99,6 +100,7 @@ async function runTest({onSuccess, onFail, onRun}: Props): Promise<void> {

if(!stdout){
console.error('SOMETHING WENT WRONG WITH A PASSING TEST')
onError()
}
// test runner failed
channel=getOutputChannel(outputChannelName)
Expand Down
12 changes: 8 additions & 4 deletionssrc/editor/commands.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -52,22 +52,26 @@ export const createCommands = ({vscodeExt}: CreateCommandProps) => {

webview.createOrShow(column)
},
[COMMANDS.RUN_TEST]:()=>{
[COMMANDS.RUN_TEST]:({stepId}:{stepId:string})=>{
console.log('run test webview',Object.keys(webview))
runTest({
onSuccess:()=>{
console.log('COMMAND TEST_PASS')
webview.send({type:'TEST_PASS'})
webview.send({type:'TEST_PASS',payload:{stepId}})
vscode.window.showInformationMessage('PASS')
},
onFail:()=>{
console.log('COMMAND TEST_FAIL')
webview.send({type:'TEST_FAIL'})
webview.send({type:'TEST_FAIL',payload:{stepId}})
vscode.window.showWarningMessage('FAIL')
},
onError:()=>{
console.log('COMMAND TEST_ERROR')
webview.send({type:'TEST_ERROR',payload:[stepId]})
},
onRun:()=>{
console.log('COMMAND TEST_RUN')
webview.send({type:'TEST_RUN'})
webview.send({type:'TEST_RUN',payload:{stepId}})
}
})
},
Expand Down
9 changes: 6 additions & 3 deletionsweb-app/src/services/channel/index.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,7 +25,6 @@ class Channel {
this.machineSend = send
}
public receive = (event: ReceivedEvent) => {
console.log('CLIENT RECEIVE')
const action = event.data

// @ts-ignore // ignore browser events from plugins
Expand All@@ -41,16 +40,20 @@ class Channel {
case 'TEST_PASS':
// { type: 'TEST_PASS', payload: { stepId: string }}
this.machineSend(action)
console.log('test passed')
return
case 'TEST_FAIL':
this.machineSend(action)
return
case 'TEST_RUN':
console.log('TEST_RUN')
this.machineSend(action)
return
case 'TEST_ERROR':
console.log('TEST_ERROR')
this.machineSend(action)
return
case 'ACTIONS_LOADED':
console.log('ACTIONS_LOADED')
// TODO: use this for verifying completion of stepActions
return
default:
if (action.type) {
Expand Down
5 changes: 1 addition & 4 deletionsweb-app/src/services/state/actions/context.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -104,13 +104,10 @@ export default {
//@ts-ignore
updateStepProgress:assign({
progress:(context:CR.MachineContext,event:CR.MachineEvent):CR.Progress=>{

// update progress by tracking completed
constcurrentProgress:CR.Progress=context.progress

// TODO: should use event id, to verify not multiple successes jumping one
// const stepId = event.payload.stepId
const{stepId}=context.position
const{stepId}=event.payload

currentProgress.steps[stepId]=true

Expand Down
1 change: 1 addition & 0 deletionsweb-app/src/services/state/machine.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -124,6 +124,7 @@ export const machine = Machine<CR.MachineContext, CR.MachineStateSchema, CR.Mach
actions:['updateStepProgress']
},
TEST_FAIL:'TestFail',
TEST_ERROR:'Normal'
},
},
TestPass:{
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp