DevLyon / mixter

CQRS and Event Sourcing Koans
http://devlyon.fr/mixter
MIT License
311 stars 81 forks source link

Koan cli #18

Closed fpellet closed 9 years ago

fpellet commented 9 years ago

Pull request for issue #3

Add cli to initialize koan and add command "next" and "jumpToNextStep" for windows and linux Works only with v2 of js I don't have a good level with batch So a review would be appreciated :) @jeantil you can test on mac

jeantil commented 9 years ago

Sur mac le script run me donne l'erreur suivante :

./run
./run: line 3: declare: -A: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
./run: line 4: declare: -A: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]

avec bash 3.2

en changeant le debut du script pour utiliser -a au lieu de -A

Language (0) ?
0
Clean repository...
Switched to branch 'master'
Initialize solution branch
Switched to a new branch 'solution'
fatal: ambiguous argument 'js/v2/full': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Done
Initialize test branch
Switched to a new branch 'test'
Done
Initialize workspace
fatal: Cannot update paths and switch to branch 'workshop' at the same time.
Did you intend to checkout 'step1' which can not be resolved as commit?
Koan OK

a priori ce qui foire c'est

+ git log js/v2/full '--pretty=tformat:%h %s' --reverse -E HEAD..
+ read line
fatal: ambiguous argument 'js/v2/full': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

mais la branche js/v2/full n'existe pas en local, seulement sur origin ...

fpellet commented 9 years ago

C'est encore du Bash 3 sur osx (le 4 sortie en 2009 quand même)! Voila j'ai corrigé tout ça reteste sur mac stp

jeantil commented 9 years ago

c'est mieux, mais pas encore nickel

Language (js, c#) ?  js
Clean repository...
Switched to branch 'master'
Initialize solution branch
Switched to a new branch 'solution'
...........................................step1 Ok
..............step2 Ok
.....step3 Ok
.................step4 Ok
.........step5 Ok
...Done
Initialize test branch
Switched to a new branch 'test'
............................................step1-test1 Ok
.step1-test2 Ok
.step1-test3 Ok
.step1-test4 Ok
........step2-test1 Ok
.....step3-test1 Ok
.step3-test2 Ok
.step3-test3 Ok
.step3-test4 Ok
...........step4-test1 Ok
.step4-test2 Ok
.step4-test3 Ok
.step4-test4 Ok
..step5-test1 Ok
.step5-test2 Ok
Done
Initialize workspace
Switched to a new branch 'workshop'
Koan OK

cat: welcome.txt: No such file or directory

il manque un fichier dans la branche cible ...

On Wed, Sep 2, 2015 at 9:53 AM fpellet notifications@github.com wrote:

C'est encore du Bash 3 sur osx (le 4 sortie en 2009 quand même)! Voila j'ai corrigé tout ça reteste sur mac stp

— Reply to this email directly or view it on GitHub https://github.com/DevLyon/mixter/pull/18#issuecomment-136968035.

fpellet commented 9 years ago

C'est normal, car c'est qu'une pull request. Si tu la merge en local, cela marche. Je vois pas trop comment faire sinon :) Par contre, je viens voir une erreur, j'ai commit "c#" dans le texte par erreur

@Ouarzy et @devcrafting vous avez le temps pour tester ou on merge ?

devcrafting commented 9 years ago

J'ai pas tout compris comment marchait le script (j'ai essaye sous linux seulement). Notamment, pourquoi il ne marche qu'avec la v2 JS. Sinon, niveau test, je n'ai pas fait toutes les etapes, mais je n'ai pas la commande "next" au demarrage (juste apres le run). Je l'ai durant le step 2, et je peux aller en next du step 2 au step 3. Remarque : si qqn veut essayer dans plusieurs langages, le script va lui effacer ses branches locales. On pourrait peut-être nommer les branches en workshop-[lang] ?

fpellet commented 9 years ago

En effet, je sais pas ce que j'ai foutu, mais c'est bon maintenant. @devcrafting tu peux retester ?

Il y a que le v2 js, car c'est la seule qui a pris en compte les issues et qui respect la convention de nommage ([Test KO]/[Test OK] et le nombre de tests par step).

L'utilisateur qui essaye plusieurs langages et qui veut garder le travail en cours, peut toujours créer une branch ou utiliser reflog pour retrouver ses commits :) On peut nommer les branches en workshop-[lang], mais j'aimerais d'abord valider cette version.

devcrafting commented 9 years ago

J'ai aussi le probleme du fichier welcome.txt manquant (apres le run). Sinon, j'ai lance le script plusieurs fois, il m'est arrive d'avoir des conflits avec le jumpToNextStep.

# On branch workshop
nothing to commit (working directory clean)
Switched to a new branch 'workshop-step3'
Auto-merging src/domain/core/updateTimeline.js
CONFLICT (add/add): Merge conflict in src/domain/core/updateTimeline.js
Auto-merging src/domain/core/message.js
CONFLICT (add/add): Merge conflict in src/domain/core/message.js
Automatic merge failed; fix conflicts and then commit the result.
[workshop-step3 c1846bb] Merge with test branch
devcrafting commented 9 years ago

Attention, les branches workshop-step ne sont pas supprimes apparemment durant le clean du script run (pourtant j'ai tente la suppression en ligne de commande seule, ca marche)

clem@Debian7:~/IdeaProjects/mixter$ git checkout KoanCli 
Switched to branch 'KoanCli'
clem@Debian7:~/IdeaProjects/mixter$ ./run 
Language (js) ?  js
Clean repository...
Switched to branch 'master'
Initialize solution branch
Switched to a new branch 'solution'
...........................................step1 Ok
..............step2 Ok
.....step3 Ok
.................step4 Ok
.........step5 Ok
...Done
Initialize test branch
Switched to a new branch 'test'
............................................step1-test1 Ok
.step1-test2 Ok
.step1-test3 Ok
.step1-test4 Ok
........step2-test1 Ok
.....step3-test1 Ok
.step3-test2 Ok
.step3-test3 Ok
.step3-test4 Ok
...........step4-test1 Ok
.step4-test2 Ok
.step4-test3 Ok
.step4-test4 Ok
..step5-test1 Ok
.step5-test2 Ok
Done
Initialize workspace
Switched to a new branch 'workshop'
Koan OK
cat: welcome.txt: No such file or directory
clem@Debian7:~/IdeaProjects/mixter$ git branch
  KoanCli
  master
  php
  php-solution
  php-tests
  solution
  test
* workshop
  workshop-step3

Pour reproduire les conflits : 4 fois ./next puis ./jumpToNextStep (par exemple, j'ai eu un autre cas) /!\ il est important d'avoir supprime les branches workshop-step manuellement (cf. bug ci-dessus) pour que cela se produise. Sinon, ca passe mais il y a une erreur "fatal" peu visible :

# On branch workshop
nothing to commit (working directory clean)
fatal: A branch named 'workshop-step3' already exists.
Updating 98fb9b0..6324f1d
Fast-forward
 jumpToNextStep                   |    4 ++--
 next                             |    2 +-
 src/domain/core/subscription.js  |   41 +++++++++++++++++++++++++++++++++++++++++
 test/domain/core/subscription.js |   48 ++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 92 insertions(+), 3 deletions(-)
 create mode 100644 src/domain/core/subscription.js
 create mode 100644 test/domain/core/subscription.js
# On branch workshop
nothing to commit (working directory clean)
fpellet commented 9 years ago

J'ai des conflits également mais ils sont résolus chez moi Si tu fais git status, tu les as encore ?

Je les ai caché dans mon dernier commit pour éviter de perturber

J'ai corrigé le bug pour la branch workshop-step3

fpellet commented 9 years ago

@jeantil et @devcrafting je vous laisse rajouter java et php et de merger

jeantil commented 9 years ago

done pour java, la branche est a jour