Skip to content
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

"You created a second Pretender instance while there was already one running" #915

Closed
denchen opened this issue Oct 12, 2016 · 14 comments
Closed

Comments

@denchen
Copy link

denchen commented Oct 12, 2016

I started getting this error today with ember-cli-mirage@0.2.2, and I'm fairly certain it has to do with Pretender 1.4.0 (that has a Notify on second Pretender fix) that was released today.

beforeEach failed on visiting /myroute/foo: You created a second Pretender instance while there
was already one running. Running two Pretender servers at once will lead to unexpected
results!Please call .shutdown() on your instances when you no longer need them to respond.

This was in my acceptance test. I have failures in my integration tests as well, which look like:

Promise rejected before it renders: Assertion Failed: You cannot use the same root element
(#ember-testing) multiple times in an Ember.Application

So what is the appropriate way to shutdown the Mirage server? I currently have this in my acceptance tests:

afterEach() {
  Ember.run(application, 'destroy');
  server.shutdown();
}

Do I need something similar in my integration tests?

@denchen
Copy link
Author

denchen commented Oct 12, 2016

I found a workaround for both my acceptance and integration tests.

In acceptance tests, my beforeEach() now looks like:

 beforeEach() {
   server.shutdown();
   application = startApp();
 },

I'm still not sure why server.shutdown() in afterEach() doesn't properly shutdown the server.

And for my integration/unit tests, I've modified the code from Manually starting up Mirage to this:

// See: http://www.ember-cli-mirage.com/docs/v0.2.x/manually-starting-mirage/
import mirageInitializer from '../../initializers/ember-cli-mirage';

export default function startMirage(container) {
  if (this.server) {
    console.warn('Shutting down Mirage server before re-initializing');
    this.server.shutdown();
  }
  mirageInitializer.initialize(container);
}

All my tests now pass. However, I'm not sure if the above modifications are what I should be doing or not.

@netes
Copy link

netes commented Oct 13, 2016

Same here.

@netes
Copy link

netes commented Oct 13, 2016

Update:
It seems that updating module-for-acceptance.js to the newest version (from Ember CLI 2.8) and adding this snippet to integration tests which use Mirage:

    afterEach() {
      server.shutdown();
    },

does the job - everything is fine then.

@dustinfarris
Copy link
Contributor

Mirage monky-patches the server.shutdown for acceptance tests, but not for integration tests. I suspect this will need to be done manually (as @netes has shown) and should be mentioned in the docs.

@morhook
Copy link
Contributor

morhook commented Oct 14, 2016

Is the #917 related to this issue?

@dustinfarris
Copy link
Contributor

Yes, it is an internal fix for the same thing. Users will need to do this on their own for now.

@morhook
Copy link
Contributor

morhook commented Oct 14, 2016

Thanks @dustinfarris ! Sounds good!

scottmtraver added a commit to scottmtraver/TrailEmber that referenced this issue Oct 16, 2016
@Leooo
Copy link
Contributor

Leooo commented Oct 17, 2016

I tried everything but still can't make it work even with one single acceptance test. Anyone is in the same case? I'm using a custom moduleForAcceptance this may be the reason why..

This is definitely due to pretenderjs/pretender#178 having been released without a major bump.

kevinansfield added a commit to kevinansfield/Ghost-Admin that referenced this issue Oct 17, 2016
no issue
- a [recent update](pretenderjs/pretender#178) to Pretender contained a breaking change that throws an error when multiple pretender instances exist
- using mirage in acceptance tests was [triggering the error](miragejs/ember-cli-mirage#915)
@shellandbull
Copy link
Contributor

temporary workaround for us on #922

@trek
Copy link

trek commented Oct 18, 2016

Pretender 1.4.1 is published and it will only give you a console.warn slap on the wrist.

@dustinfarris
Copy link
Contributor

Thanks @trek. I think we should still try to dissuade users from overlapping servers going forward though by updating the documentation here.

For example, users relying on startMirage in their integration tests need to know why they are going to start seeing this warning.

I don't think there is a way to automagically handle this like we do for acceptance tests because moduleForComponent comes directly from ember-qunit, probably best to just advise users to run shutdown after using it.

@trek
Copy link

trek commented Oct 18, 2016

Overlapping servers will also prevent some useful tools like https://percy.io/ from running in projects that use Mirage in tests.

kevinansfield added a commit to kevinansfield/Ghost-Admin that referenced this issue Jan 5, 2017
no issue
- a [recent update](pretenderjs/pretender#178) to Pretender contained a breaking change that throws an error when multiple pretender instances exist
- using mirage in acceptance tests was [triggering the error](miragejs/ember-cli-mirage#915)
acburdine pushed a commit to TryGhost/Admin that referenced this issue Jan 5, 2017
no issue
- a [recent update](pretenderjs/pretender#178) to Pretender contained a breaking change that throws an error when multiple pretender instances exist
- using mirage in acceptance tests was [triggering the error](miragejs/ember-cli-mirage#915)
kevinansfield added a commit to kevinansfield/Ghost-Admin that referenced this issue Jan 5, 2017
no issue
- a [recent update](pretenderjs/pretender#178) to Pretender contained a breaking change that throws an error when multiple pretender instances exist
- using mirage in acceptance tests was [triggering the error](miragejs/ember-cli-mirage#915)
acburdine pushed a commit to TryGhost/Admin that referenced this issue Jan 5, 2017
no issue
- a [recent update](pretenderjs/pretender#178) to Pretender contained a breaking change that throws an error when multiple pretender instances exist
- using mirage in acceptance tests was [triggering the error](miragejs/ember-cli-mirage#915)
@mdarmetko
Copy link

I'm using mostly default generated tests with ember 2.10 and was having this issue. Resolved it by adding if(server !== undefined) { server.shutdown(); } to beforeEach and afterEach in each acceptance test file. As in,

module('Acceptance: Metro', {
  beforeEach: function() {
    if(server !== undefined) { server.shutdown(); }
    application = startApp();
    originalConfirm = window.confirm;
    window.confirm = function() {
      confirmCalledWith = [].slice.call(arguments);
      return true;
    };
  },
  afterEach: function() {
    Ember.run(application, 'destroy');
    window.confirm = originalConfirm;
    confirmCalledWith = null;
    if(server !== undefined) { server.shutdown(); }
  }
});

Hope this helps someone else having the same problem.

kemenaran added a commit to kemenaran/pix that referenced this issue Apr 10, 2017
This fixes a "You created a second Pretender instance
while there was already one running" warning during
acceptance tests.

See miragejs/ember-cli-mirage#915
kemenaran added a commit to kemenaran/pix that referenced this issue Apr 10, 2017
This fixes a "You created a second Pretender instance
while there was already one running" warning during
acceptance tests.

See miragejs/ember-cli-mirage#915
kemenaran added a commit to kemenaran/pix that referenced this issue Apr 10, 2017
This fixes a "You created a second Pretender instance
while there was already one running" warning during
acceptance tests.

See miragejs/ember-cli-mirage#915
kemenaran added a commit to betagouv/pix that referenced this issue Apr 10, 2017
This fixes a "You created a second Pretender instance
while there was already one running" warning during
acceptance tests.

See miragejs/ember-cli-mirage#915
jbuget pushed a commit to betagouv/pix that referenced this issue Apr 20, 2017
…oduction et suppression de scripts d'import (US-449) (#372)

* [#353][BUGFIX] Fix placement-tests HTML and route for placeholder images (#353)

[#353] [BUGFIX] Correction du rendu de la route /placement-tests (US-425).

* [#357] [FEATURE] Sauvegarder le temps écoulé pour chaque épreuve (US-361). (#357)

* New migration to add elapsed time to Answers table

* Add elapsedTime attributes in answer-serializer

* Add test to answer-controller-update

* Api is ready to receive elapsed time

* improve node version for coverage

* Update answer model

* component save time elapsed but no test added

* Fix review comments

* [#364] [INFRA] Extraction des identifiants Airtable dans des variables d'environnement (US-430). (#364)

* Add tasks to configure environment for development

* Fix build

* Remove useless description in README.md

* shutdown pretender server on app destroy (#362)

This fixes a "You created a second Pretender instance
while there was already one running" warning during
acceptance tests.

See miragejs/ember-cli-mirage#915

* de-duplicate email validation code (#361)

Use an utility function for validating email adresses (rather than a
full-blown service).

IMO Services should be used when the service is a object with several
method. In this case instantiating a service makes sense.

When the code is a simple function, an utility in `utils/` is simpler,
and involves less boilerplate.

This commit has the nice side-effect of actually simplifying the code
that uses the email validation: no need to inject a custom service,
or to define a private helper function.

* [#366] [INFRA] Correction d'avertissements dans les tests : "unsafe CSS bindings" (#366)

* progress-bar: escape CSS style

Fix a Glimmer warning about unescaped classes.

* timeout-jauge: escape CSS style

Fix a Glimmer warning about unescaped classes.

* [#360] [CLEANUP] Meilleure gestion des conditions de tests liées à l'environnement (issue #335). (#360)

* Add variable spy in config to detect if Env is test

* fix lint errors

* Fix all

* delete useless space

* Add Env variables according to theirs intents to components where they are used

* delete intestMode variable

* Attache env variables to APP context

* Fix bug en staging le timer enregistrait toujours 0 dans le temps écoulé (#369)

* [#368] [BUGFIX] Enlever le séparateur de la zone de réponse pour les QROCM (US-369) (#368)

* transform hr to br and add margin beetween inputs

* second commit to have a review app

* delete breakline for qroc which appear sometimes

* [#342] [FEATURE] Affichage de la zone de correction pour les challenges QROCM-ind (US-385) (#342)

* first commit

* create component

* ajout test intégration sur comparison window

* continuer sur box de comparaison pour QROC

* implem QROC sans les tests

* make previous tests pass

* add unit test on component qroc-answer-comparison-box

* add integration test on qroc-answer-comparison-box

* refacto jerem

* refacto

* add acceptance tests

* add acceptance tests1

* rename pour qroc-solution-panel and create qrocm solution panel

* Fix tests

* back-up for qrocm-ind

* commit to change branch

* rename component

* wip regex labels treatments

* create component qrocm-ind and first computed property

* labelstodiplay done with test, reflexion on answers to dispay

* wip

* wip reflexion comment organiser les donner à envoyer hbs

* computed property to formate the data, done and tested

* computed property done with bug

* no bug anymore, wip on dataToDisplay

* tentative avec proposalsAsBlock

* utilise le proposal block, reste à derterminer comment on connait la validité de chacune des reponse

* succeed parse des label avec ${} \o/

* basic front done mais retour du bug avec pas de grisement derrière la popin

* tentative de resolution de bug

* add unit test to computed property and about to start the html/css

* refacto computed property to facilitate css of right/wrong/no Asnwer possibility on front

* front done, il manque juste un alignement de la bonne reponse en dessous de l'input

* alignement reponse/solution done

* display only one solution on front and start integration test skull

* delete a log

* integration tests done

* refacto real unit test

* finish unit test

* fix regression sur qroc (affiche la reponse meme quand c'est bon)

* add unit test

* fix bug for qrocm passed answer and refacto computed property

* delete .only in test

* fix make tests pass

* delete comment

* computed properties of qrocm-ind passed to utils, need to be refacto

* delete comment

* delete comment

* refacto

* end of the merge

* Try to fix circle.yml for bower

* refacto 1

* adds from tech review

* regler bug benjamin sur la review app et ajout de test

* delete .only

* click sur zone grisé fait sortir de la modale + test

* test to save resultDetails done

* ajout de la propriété enabledTreatments dans le serializer airtable de solution. refacto emplacement de t1, t2 et t3 + ajout de tests pour ces fonctions. modification de applyTreatments onSolutions en utilisant les fonction t1 t2 t3, wip modification des tests de match dans solution-service-qrocmind en ajoutant le champs enabledTreatments

* refacto solution-service-qrocm-ind

* Fucking code

* Fucking code

* aaaaaaaah resolved test :)

* make tests pass after pull

* refacto tests

* Fix the fucking tests

* add save of resultDetails in dataBase

* resolve api answer serializer, implement fronts

* debut refacto, le nouveau answersAsObjects ne fonctionne pas comme on le veut avec reduce, A VOIR

* Fix the build

* Oops

* Refactor solution-services-x

* Some refactoring

* Continue to refactor

* Continue to refactor

* Continue to refactor

* Rename solution-service#match into #revalidate

* Take into account code review remarks

* delete comment and rename en camelCase

* refacto sur nom de variables test api

* continuing refacto

* refacto with pierre and florian dans qrocm ind solution panel

* gestion du cas où le challenge QROCM-ind est passé (null\n est enregistré en base)

* fix when resultdetailsYaml is null

* last change from jeremy review (!= to !==)

* delete import dir

* reactivate mailjet

* keep sqlite in package .json
Akhilian pushed a commit to betagouv/pix that referenced this issue Apr 20, 2017
…oduction et suppression de scripts d'import (US-449) (#372)

* [#353][BUGFIX] Fix placement-tests HTML and route for placeholder images (#353)

[#353] [BUGFIX] Correction du rendu de la route /placement-tests (US-425).

* [#357] [FEATURE] Sauvegarder le temps écoulé pour chaque épreuve (US-361). (#357)

* New migration to add elapsed time to Answers table

* Add elapsedTime attributes in answer-serializer

* Add test to answer-controller-update

* Api is ready to receive elapsed time

* improve node version for coverage

* Update answer model

* component save time elapsed but no test added

* Fix review comments

* [#364] [INFRA] Extraction des identifiants Airtable dans des variables d'environnement (US-430). (#364)

* Add tasks to configure environment for development

* Fix build

* Remove useless description in README.md

* shutdown pretender server on app destroy (#362)

This fixes a "You created a second Pretender instance
while there was already one running" warning during
acceptance tests.

See miragejs/ember-cli-mirage#915

* de-duplicate email validation code (#361)

Use an utility function for validating email adresses (rather than a
full-blown service).

IMO Services should be used when the service is a object with several
method. In this case instantiating a service makes sense.

When the code is a simple function, an utility in `utils/` is simpler,
and involves less boilerplate.

This commit has the nice side-effect of actually simplifying the code
that uses the email validation: no need to inject a custom service,
or to define a private helper function.

* [#366] [INFRA] Correction d'avertissements dans les tests : "unsafe CSS bindings" (#366)

* progress-bar: escape CSS style

Fix a Glimmer warning about unescaped classes.

* timeout-jauge: escape CSS style

Fix a Glimmer warning about unescaped classes.

* [#360] [CLEANUP] Meilleure gestion des conditions de tests liées à l'environnement (issue #335). (#360)

* Add variable spy in config to detect if Env is test

* fix lint errors

* Fix all

* delete useless space

* Add Env variables according to theirs intents to components where they are used

* delete intestMode variable

* Attache env variables to APP context

* Fix bug en staging le timer enregistrait toujours 0 dans le temps écoulé (#369)

* [#368] [BUGFIX] Enlever le séparateur de la zone de réponse pour les QROCM (US-369) (#368)

* transform hr to br and add margin beetween inputs

* second commit to have a review app

* delete breakline for qroc which appear sometimes

* [#342] [FEATURE] Affichage de la zone de correction pour les challenges QROCM-ind (US-385) (#342)

* first commit

* create component

* ajout test intégration sur comparison window

* continuer sur box de comparaison pour QROC

* implem QROC sans les tests

* make previous tests pass

* add unit test on component qroc-answer-comparison-box

* add integration test on qroc-answer-comparison-box

* refacto jerem

* refacto

* add acceptance tests

* add acceptance tests1

* rename pour qroc-solution-panel and create qrocm solution panel

* Fix tests

* back-up for qrocm-ind

* commit to change branch

* rename component

* wip regex labels treatments

* create component qrocm-ind and first computed property

* labelstodiplay done with test, reflexion on answers to dispay

* wip

* wip reflexion comment organiser les donner à envoyer hbs

* computed property to formate the data, done and tested

* computed property done with bug

* no bug anymore, wip on dataToDisplay

* tentative avec proposalsAsBlock

* utilise le proposal block, reste à derterminer comment on connait la validité de chacune des reponse

* succeed parse des label avec ${} \o/

* basic front done mais retour du bug avec pas de grisement derrière la popin

* tentative de resolution de bug

* add unit test to computed property and about to start the html/css

* refacto computed property to facilitate css of right/wrong/no Asnwer possibility on front

* front done, il manque juste un alignement de la bonne reponse en dessous de l'input

* alignement reponse/solution done

* display only one solution on front and start integration test skull

* delete a log

* integration tests done

* refacto real unit test

* finish unit test

* fix regression sur qroc (affiche la reponse meme quand c'est bon)

* add unit test

* fix bug for qrocm passed answer and refacto computed property

* delete .only in test

* fix make tests pass

* delete comment

* computed properties of qrocm-ind passed to utils, need to be refacto

* delete comment

* delete comment

* refacto

* end of the merge

* Try to fix circle.yml for bower

* refacto 1

* adds from tech review

* regler bug benjamin sur la review app et ajout de test

* delete .only

* click sur zone grisé fait sortir de la modale + test

* test to save resultDetails done

* ajout de la propriété enabledTreatments dans le serializer airtable de solution. refacto emplacement de t1, t2 et t3 + ajout de tests pour ces fonctions. modification de applyTreatments onSolutions en utilisant les fonction t1 t2 t3, wip modification des tests de match dans solution-service-qrocmind en ajoutant le champs enabledTreatments

* refacto solution-service-qrocm-ind

* Fucking code

* Fucking code

* aaaaaaaah resolved test :)

* make tests pass after pull

* refacto tests

* Fix the fucking tests

* add save of resultDetails in dataBase

* resolve api answer serializer, implement fronts

* debut refacto, le nouveau answersAsObjects ne fonctionne pas comme on le veut avec reduce, A VOIR

* Fix the build

* Oops

* Refactor solution-services-x

* Some refactoring

* Continue to refactor

* Continue to refactor

* Continue to refactor

* Rename solution-service#match into #revalidate

* Take into account code review remarks

* delete comment and rename en camelCase

* refacto sur nom de variables test api

* continuing refacto

* refacto with pierre and florian dans qrocm ind solution panel

* gestion du cas où le challenge QROCM-ind est passé (null\n est enregistré en base)

* fix when resultdetailsYaml is null

* last change from jeremy review (!= to !==)

* delete import dir

* reactivate mailjet

* keep sqlite in package .json
jbuget pushed a commit to betagouv/pix that referenced this issue Apr 24, 2017
…lit avec master + MAJ de dev sur Master (#378)

* try to restore prod

* [#370] [CLEANUP] Suppression des positional params. (#370)

* Remove deprecated and unused components app-header and app-footer

* Remove positional params for component comparison-window

* Oops (forgotten .only in tests)

* Remove positional params for component challenge-statement

* Declare 'challenge' as a component property for challenge-statement

* Remove positional params for component feedback-panel

* Remove positional params for component qroc-solution-panel

* Fix tests

* On expose un nouvel endpoint avec les infos api sur /api (#375)

[#375] [FEATURE] On expose un nouvel endpoint avec les infos api sur /api (US-453).

* Changement de version 1.6.2 vers 1.6.3

* Update CHANGELOG.md

* [#283] [FEATURE] Ajout des acquis aux épreuves pour calculer le niveau de l'apprenant (US-360). (#283)

* Add knowledge (acquis) to challengeSerializer

* Add acquix to acquired / not_acquired arrays

* Add tests for assessment level estimation

* Fix tests for computing level of assessments

* Add unit tests and compute PIX score

* Fallback when history is empty or challenge has no knowledge

* Take review into account

* Rename variable

* Make a service for populating scores in assessments

* Add unit tests

* Refactor code

* Cleanup

* Extracting getScoredAssessment in the assessment service

* Refactoring ChallengeService#getKnowledgeData

* Missing semicolon on changes

* Extracting the performance statistics in a specific file + creating tests

* Lets refactor the Scoring#getPerformanceStats function

* Adding tests on Scoring#computeDiagnosis

* Refactoring #populateScore into #_completeAssessmentWithScore

* Refactoring assessmentService#getScoredAssessment and creating tests

* Introducing a 404 error when the assessment does not exist

* Renamming skill to knowledge to preserve consistency

* Add forgotten important test

* Fix test

* Refactor old for..in form into lo-dash _.forOwn

* [#372] [CLEANUP] Importation des followers dans base de données de production et suppression de scripts d'import (US-449) (#372)

* [#353][BUGFIX] Fix placement-tests HTML and route for placeholder images (#353)

[#353] [BUGFIX] Correction du rendu de la route /placement-tests (US-425).

* [#357] [FEATURE] Sauvegarder le temps écoulé pour chaque épreuve (US-361). (#357)

* New migration to add elapsed time to Answers table

* Add elapsedTime attributes in answer-serializer

* Add test to answer-controller-update

* Api is ready to receive elapsed time

* improve node version for coverage

* Update answer model

* component save time elapsed but no test added

* Fix review comments

* [#364] [INFRA] Extraction des identifiants Airtable dans des variables d'environnement (US-430). (#364)

* Add tasks to configure environment for development

* Fix build

* Remove useless description in README.md

* shutdown pretender server on app destroy (#362)

This fixes a "You created a second Pretender instance
while there was already one running" warning during
acceptance tests.

See miragejs/ember-cli-mirage#915

* de-duplicate email validation code (#361)

Use an utility function for validating email adresses (rather than a
full-blown service).

IMO Services should be used when the service is a object with several
method. In this case instantiating a service makes sense.

When the code is a simple function, an utility in `utils/` is simpler,
and involves less boilerplate.

This commit has the nice side-effect of actually simplifying the code
that uses the email validation: no need to inject a custom service,
or to define a private helper function.

* [#366] [INFRA] Correction d'avertissements dans les tests : "unsafe CSS bindings" (#366)

* progress-bar: escape CSS style

Fix a Glimmer warning about unescaped classes.

* timeout-jauge: escape CSS style

Fix a Glimmer warning about unescaped classes.

* [#360] [CLEANUP] Meilleure gestion des conditions de tests liées à l'environnement (issue #335). (#360)

* Add variable spy in config to detect if Env is test

* fix lint errors

* Fix all

* delete useless space

* Add Env variables according to theirs intents to components where they are used

* delete intestMode variable

* Attache env variables to APP context

* Fix bug en staging le timer enregistrait toujours 0 dans le temps écoulé (#369)

* [#368] [BUGFIX] Enlever le séparateur de la zone de réponse pour les QROCM (US-369) (#368)

* transform hr to br and add margin beetween inputs

* second commit to have a review app

* delete breakline for qroc which appear sometimes

* [#342] [FEATURE] Affichage de la zone de correction pour les challenges QROCM-ind (US-385) (#342)

* first commit

* create component

* ajout test intégration sur comparison window

* continuer sur box de comparaison pour QROC

* implem QROC sans les tests

* make previous tests pass

* add unit test on component qroc-answer-comparison-box

* add integration test on qroc-answer-comparison-box

* refacto jerem

* refacto

* add acceptance tests

* add acceptance tests1

* rename pour qroc-solution-panel and create qrocm solution panel

* Fix tests

* back-up for qrocm-ind

* commit to change branch

* rename component

* wip regex labels treatments

* create component qrocm-ind and first computed property

* labelstodiplay done with test, reflexion on answers to dispay

* wip

* wip reflexion comment organiser les donner à envoyer hbs

* computed property to formate the data, done and tested

* computed property done with bug

* no bug anymore, wip on dataToDisplay

* tentative avec proposalsAsBlock

* utilise le proposal block, reste à derterminer comment on connait la validité de chacune des reponse

* succeed parse des label avec ${} \o/

* basic front done mais retour du bug avec pas de grisement derrière la popin

* tentative de resolution de bug

* add unit test to computed property and about to start the html/css

* refacto computed property to facilitate css of right/wrong/no Asnwer possibility on front

* front done, il manque juste un alignement de la bonne reponse en dessous de l'input

* alignement reponse/solution done

* display only one solution on front and start integration test skull

* delete a log

* integration tests done

* refacto real unit test

* finish unit test

* fix regression sur qroc (affiche la reponse meme quand c'est bon)

* add unit test

* fix bug for qrocm passed answer and refacto computed property

* delete .only in test

* fix make tests pass

* delete comment

* computed properties of qrocm-ind passed to utils, need to be refacto

* delete comment

* delete comment

* refacto

* end of the merge

* Try to fix circle.yml for bower

* refacto 1

* adds from tech review

* regler bug benjamin sur la review app et ajout de test

* delete .only

* click sur zone grisé fait sortir de la modale + test

* test to save resultDetails done

* ajout de la propriété enabledTreatments dans le serializer airtable de solution. refacto emplacement de t1, t2 et t3 + ajout de tests pour ces fonctions. modification de applyTreatments onSolutions en utilisant les fonction t1 t2 t3, wip modification des tests de match dans solution-service-qrocmind en ajoutant le champs enabledTreatments

* refacto solution-service-qrocm-ind

* Fucking code

* Fucking code

* aaaaaaaah resolved test :)

* make tests pass after pull

* refacto tests

* Fix the fucking tests

* add save of resultDetails in dataBase

* resolve api answer serializer, implement fronts

* debut refacto, le nouveau answersAsObjects ne fonctionne pas comme on le veut avec reduce, A VOIR

* Fix the build

* Oops

* Refactor solution-services-x

* Some refactoring

* Continue to refactor

* Continue to refactor

* Continue to refactor

* Rename solution-service#match into #revalidate

* Take into account code review remarks

* delete comment and rename en camelCase

* refacto sur nom de variables test api

* continuing refacto

* refacto with pierre and florian dans qrocm ind solution panel

* gestion du cas où le challenge QROCM-ind est passé (null\n est enregistré en base)

* fix when resultdetailsYaml is null

* last change from jeremy review (!= to !==)

* delete import dir

* reactivate mailjet

* keep sqlite in package .json

* [376] [CLEANUP] Amélioration de l'image de présentation sur la page d'accueil (US-417). (#376)

* Replace index hero image by new one

* Decrease home page image height

* [#373] [BUGFIX] Affichage de l'avertissement 'epreuve timée' lorsque deux challenges du même type se suivent (US-424) (#373)

* resolve bug, about to add a test

* add acceptance test

* Restore dotenv sample file

* Refactor component to follow team standards elements of a component order

* Nouvelle version du projet : v1.7.0 (précédement v1.6.3)

* Update CHANGELOG.md

* [INFRA] Mise à jour du script pour gèrer les problèmes de conflit avec master
jbuget pushed a commit to betagouv/pix that referenced this issue Jul 12, 2017
…ement dédié (US-456). (#461)

* try to restore prod

* [#370] [CLEANUP] Suppression des positional params. (#370)

* Remove deprecated and unused components app-header and app-footer

* Remove positional params for component comparison-window

* Oops (forgotten .only in tests)

* Remove positional params for component challenge-statement

* Declare 'challenge' as a component property for challenge-statement

* Remove positional params for component feedback-panel

* Remove positional params for component qroc-solution-panel

* Fix tests

* On expose un nouvel endpoint avec les infos api sur /api (#375)

[#375] [FEATURE] On expose un nouvel endpoint avec les infos api sur /api (US-453).

* Changement de version 1.6.2 vers 1.6.3

* Update CHANGELOG.md

* [#283] [FEATURE] Ajout des acquis aux épreuves pour calculer le niveau de l'apprenant (US-360). (#283)

* Add knowledge (acquis) to challengeSerializer

* Add acquix to acquired / not_acquired arrays

* Add tests for assessment level estimation

* Fix tests for computing level of assessments

* Add unit tests and compute PIX score

* Fallback when history is empty or challenge has no knowledge

* Take review into account

* Rename variable

* Make a service for populating scores in assessments

* Add unit tests

* Refactor code

* Cleanup

* Extracting getScoredAssessment in the assessment service

* Refactoring ChallengeService#getKnowledgeData

* Missing semicolon on changes

* Extracting the performance statistics in a specific file + creating tests

* Lets refactor the Scoring#getPerformanceStats function

* Adding tests on Scoring#computeDiagnosis

* Refactoring #populateScore into #_completeAssessmentWithScore

* Refactoring assessmentService#getScoredAssessment and creating tests

* Introducing a 404 error when the assessment does not exist

* Renamming skill to knowledge to preserve consistency

* Add forgotten important test

* Fix test

* Refactor old for..in form into lo-dash _.forOwn

* [#372] [CLEANUP] Importation des followers dans base de données de production et suppression de scripts d'import (US-449) (#372)

* [#353][BUGFIX] Fix placement-tests HTML and route for placeholder images (#353)

[#353] [BUGFIX] Correction du rendu de la route /placement-tests (US-425).

* [#357] [FEATURE] Sauvegarder le temps écoulé pour chaque épreuve (US-361). (#357)

* New migration to add elapsed time to Answers table

* Add elapsedTime attributes in answer-serializer

* Add test to answer-controller-update

* Api is ready to receive elapsed time

* improve node version for coverage

* Update answer model

* component save time elapsed but no test added

* Fix review comments

* [#364] [INFRA] Extraction des identifiants Airtable dans des variables d'environnement (US-430). (#364)

* Add tasks to configure environment for development

* Fix build

* Remove useless description in README.md

* shutdown pretender server on app destroy (#362)

This fixes a "You created a second Pretender instance
while there was already one running" warning during
acceptance tests.

See miragejs/ember-cli-mirage#915

* de-duplicate email validation code (#361)

Use an utility function for validating email adresses (rather than a
full-blown service).

IMO Services should be used when the service is a object with several
method. In this case instantiating a service makes sense.

When the code is a simple function, an utility in `utils/` is simpler,
and involves less boilerplate.

This commit has the nice side-effect of actually simplifying the code
that uses the email validation: no need to inject a custom service,
or to define a private helper function.

* [#366] [INFRA] Correction d'avertissements dans les tests : "unsafe CSS bindings" (#366)

* progress-bar: escape CSS style

Fix a Glimmer warning about unescaped classes.

* timeout-jauge: escape CSS style

Fix a Glimmer warning about unescaped classes.

* [#360] [CLEANUP] Meilleure gestion des conditions de tests liées à l'environnement (issue #335). (#360)

* Add variable spy in config to detect if Env is test

* fix lint errors

* Fix all

* delete useless space

* Add Env variables according to theirs intents to components where they are used

* delete intestMode variable

* Attache env variables to APP context

* Fix bug en staging le timer enregistrait toujours 0 dans le temps écoulé (#369)

* [#368] [BUGFIX] Enlever le séparateur de la zone de réponse pour les QROCM (US-369) (#368)

* transform hr to br and add margin beetween inputs

* second commit to have a review app

* delete breakline for qroc which appear sometimes

* [#342] [FEATURE] Affichage de la zone de correction pour les challenges QROCM-ind (US-385) (#342)

* first commit

* create component

* ajout test intégration sur comparison window

* continuer sur box de comparaison pour QROC

* implem QROC sans les tests

* make previous tests pass

* add unit test on component qroc-answer-comparison-box

* add integration test on qroc-answer-comparison-box

* refacto jerem

* refacto

* add acceptance tests

* add acceptance tests1

* rename pour qroc-solution-panel and create qrocm solution panel

* Fix tests

* back-up for qrocm-ind

* commit to change branch

* rename component

* wip regex labels treatments

* create component qrocm-ind and first computed property

* labelstodiplay done with test, reflexion on answers to dispay

* wip

* wip reflexion comment organiser les donner à envoyer hbs

* computed property to formate the data, done and tested

* computed property done with bug

* no bug anymore, wip on dataToDisplay

* tentative avec proposalsAsBlock

* utilise le proposal block, reste à derterminer comment on connait la validité de chacune des reponse

* succeed parse des label avec ${} \o/

* basic front done mais retour du bug avec pas de grisement derrière la popin

* tentative de resolution de bug

* add unit test to computed property and about to start the html/css

* refacto computed property to facilitate css of right/wrong/no Asnwer possibility on front

* front done, il manque juste un alignement de la bonne reponse en dessous de l'input

* alignement reponse/solution done

* display only one solution on front and start integration test skull

* delete a log

* integration tests done

* refacto real unit test

* finish unit test

* fix regression sur qroc (affiche la reponse meme quand c'est bon)

* add unit test

* fix bug for qrocm passed answer and refacto computed property

* delete .only in test

* fix make tests pass

* delete comment

* computed properties of qrocm-ind passed to utils, need to be refacto

* delete comment

* delete comment

* refacto

* end of the merge

* Try to fix circle.yml for bower

* refacto 1

* adds from tech review

* regler bug benjamin sur la review app et ajout de test

* delete .only

* click sur zone grisé fait sortir de la modale + test

* test to save resultDetails done

* ajout de la propriété enabledTreatments dans le serializer airtable de solution. refacto emplacement de t1, t2 et t3 + ajout de tests pour ces fonctions. modification de applyTreatments onSolutions en utilisant les fonction t1 t2 t3, wip modification des tests de match dans solution-service-qrocmind en ajoutant le champs enabledTreatments

* refacto solution-service-qrocm-ind

* Fucking code

* Fucking code

* aaaaaaaah resolved test :)

* make tests pass after pull

* refacto tests

* Fix the fucking tests

* add save of resultDetails in dataBase

* resolve api answer serializer, implement fronts

* debut refacto, le nouveau answersAsObjects ne fonctionne pas comme on le veut avec reduce, A VOIR

* Fix the build

* Oops

* Refactor solution-services-x

* Some refactoring

* Continue to refactor

* Continue to refactor

* Continue to refactor

* Rename solution-service#match into #revalidate

* Take into account code review remarks

* delete comment and rename en camelCase

* refacto sur nom de variables test api

* continuing refacto

* refacto with pierre and florian dans qrocm ind solution panel

* gestion du cas où le challenge QROCM-ind est passé (null\n est enregistré en base)

* fix when resultdetailsYaml is null

* last change from jeremy review (!= to !==)

* delete import dir

* reactivate mailjet

* keep sqlite in package .json

* [376] [CLEANUP] Amélioration de l'image de présentation sur la page d'accueil (US-417). (#376)

* Replace index hero image by new one

* Decrease home page image height

* [#373] [BUGFIX] Affichage de l'avertissement 'epreuve timée' lorsque deux challenges du même type se suivent (US-424) (#373)

* resolve bug, about to add a test

* add acceptance test

* Restore dotenv sample file

* Refactor component to follow team standards elements of a component order

* Nouvelle version du projet : v1.7.0 (précédement v1.6.3)

* Update CHANGELOG.md

* Creating a new command to update Preview
@DimkaVardina
Copy link

You saved my day! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants