Repository: ember-cli/ember-cli
Pull request #8945 (2019-11-26 11:04:36)

fix npm floating deps addon travis bug
I noticed I made a mistake when looking at https://travis-ci.org/ember-cli/ember-addon-output/builds/612417903. The `npm test` `script:` was not inheriting like I thought. This fixes it like yarn, and also moves floating deps to the later stage to get faster feedback.


Patch:
diff --git a/blueprints/addon/files/.travis.yml b/blueprints/addon/files/.travis.yml
index a124617a3..636fa962d 100644
--- a/blueprints/addon/files/.travis.yml
+++ b/blueprints/addon/files/.travis.yml
@@ -36,25 +36,24 @@ jobs:
 
   include:
     # runs linting and tests with current locked deps
-
     - stage: "Tests"
       name: "Tests"
       script:
-        - <% if (yarn) { %>yarn lint:hbs<% } else { %>npm run lint:hbs<% } %>
-        - <% if (yarn) { %>yarn lint:js<% } else { %>npm run lint:js<% } %>
-        - <% if (yarn) { %>yarn test<% } else { %>npm test<% } %>
+        - <% if (yarn) { %>yarn<% } else { %>npm run<% } %> lint:hbs
+        - <% if (yarn) { %>yarn<% } else { %>npm run<% } %> lint:js
+        - <% if (yarn) { %>yarn<% } else { %>npm<% } %> test
 
-    - name: "Floating Dependencies"
+    - stage: "Additional Tests"
+      name: "Floating Dependencies"
       install:<% if (yarn) { %>
-        - yarn install --no-lockfile --non-interactive
-      script:
-        - yarn test<% } else { %>
+        - yarn install --no-lockfile --non-interactive<% } else { %>
         - npm install --no-package-lock<% } %>
+      script:
+        - <% if (yarn) { %>yarn<% } else { %>npm<% } %> test
 
     # we recommend new addons test the current and previous LTS
     # as well as latest stable release (bonus points to beta/canary)
-    - stage: "Additional Tests"
-      env: EMBER_TRY_SCENARIO=ember-lts-3.4
+    - env: EMBER_TRY_SCENARIO=ember-lts-3.4
     - env: EMBER_TRY_SCENARIO=ember-lts-3.8
     - env: EMBER_TRY_SCENARIO=ember-release
     - env: EMBER_TRY_SCENARIO=ember-beta


Test patch:
diff --git a/tests/fixtures/addon/npm/.travis.yml b/tests/fixtures/addon/npm/.travis.yml
index a19c80a85..c1b82532d 100644
--- a/tests/fixtures/addon/npm/.travis.yml
+++ b/tests/fixtures/addon/npm/.travis.yml
@@ -33,7 +33,6 @@ jobs:
 
   include:
     # runs linting and tests with current locked deps
-
     - stage: "Tests"
       name: "Tests"
       script:
@@ -41,14 +40,16 @@ jobs:
         - npm run lint:js
         - npm test
 
-    - name: "Floating Dependencies"
+    - stage: "Additional Tests"
+      name: "Floating Dependencies"
       install:
         - npm install --no-package-lock
+      script:
+        - npm test
 
     # we recommend new addons test the current and previous LTS
     # as well as latest stable release (bonus points to beta/canary)
-    - stage: "Additional Tests"
-      env: EMBER_TRY_SCENARIO=ember-lts-3.4
+    - env: EMBER_TRY_SCENARIO=ember-lts-3.4
     - env: EMBER_TRY_SCENARIO=ember-lts-3.8
     - env: EMBER_TRY_SCENARIO=ember-release
     - env: EMBER_TRY_SCENARIO=ember-beta
diff --git a/tests/fixtures/addon/yarn/.travis.yml b/tests/fixtures/addon/yarn/.travis.yml
index 5cf2b5e9b..3224cb57d 100644
--- a/tests/fixtures/addon/yarn/.travis.yml
+++ b/tests/fixtures/addon/yarn/.travis.yml
@@ -32,7 +32,6 @@ jobs:
 
   include:
     # runs linting and tests with current locked deps
-
     - stage: "Tests"
       name: "Tests"
       script:
@@ -40,7 +39,8 @@ jobs:
         - yarn lint:js
         - yarn test
 
-    - name: "Floating Dependencies"
+    - stage: "Additional Tests"
+      name: "Floating Dependencies"
       install:
         - yarn install --no-lockfile --non-interactive
       script:
@@ -48,8 +48,7 @@ jobs:
 
     # we recommend new addons test the current and previous LTS
     # as well as latest stable release (bonus points to beta/canary)
-    - stage: "Additional Tests"
-      env: EMBER_TRY_SCENARIO=ember-lts-3.4
+    - env: EMBER_TRY_SCENARIO=ember-lts-3.4
     - env: EMBER_TRY_SCENARIO=ember-lts-3.8
     - env: EMBER_TRY_SCENARIO=ember-release
     - env: EMBER_TRY_SCENARIO=ember-beta