Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

chore(travis/build.sh): move ddescribe check before unit tests #13517

Closed
wants to merge 1 commit into from

Conversation

Narretz
Copy link
Contributor

@Narretz Narretz commented Dec 11, 2015

This was changed as part of #9792.
While the logic is sound that style errors shouldn't block tests from
running, ddescribe should run before the tests.
Otherwise, when Travis exits with a warning after some browsers have run,
ddescribe doesn't get run and it doesn't immediately become apparent
that not all tests have run.

@@ -12,6 +12,7 @@ if [ $JOB = "unit" ]; then
BROWSERS="SL_Chrome,SL_Safari,SL_Firefox,SL_IE_9,SL_IE_10,SL_IE_11,SL_iOS"
fi

grunt ddescribe-iit
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH, I would prefer running all ci-checks (except for jscs) first and just run jscs after the unit tests.

@Narretz Narretz force-pushed the chore-travis-build branch 3 times, most recently from 1e021b3 to 20227e2 Compare December 14, 2015 21:57
@Narretz
Copy link
Contributor Author

Narretz commented Dec 14, 2015

I've created a new task that includes ddescribe-iit, jshint and merge-conflicts. jscs is run after the tests run.

@@ -355,6 +355,7 @@ module.exports = function(grunt) {
grunt.registerTask('minify', ['bower','clean', 'build', 'minall']);
grunt.registerTask('webserver', ['connect:devserver']);
grunt.registerTask('package', ['bower','clean', 'buildall', 'minall', 'collect-errors', 'docs', 'copy', 'write', 'compress']);
grunt.registerTask('ci-checks', ['ddescribe-iit', 'merge-conflict', 'jshint', 'jscs']);
grunt.registerTask('ci-pre-checks', ['ddescribe-iit', 'jshint', 'merge-conflict']);
grunt.registerTask('ci-checks', ['merge-conflict', 'jshint', 'jscs']);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was removing ddescribe-iit from this task intended ?

@Narretz
Copy link
Contributor Author

Narretz commented Dec 15, 2015

Updated. Good catches!

grunt test:promises-aplus
grunt test:unit --browsers $BROWSERS --reporters dots
grunt ci-checks
grunt jcsc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jcsc --> jscs (:smiley:)

@gkalpak
Copy link
Member

gkalpak commented Dec 15, 2015

LGTM (with typo fixed) 👍

@petebacondarwin
Copy link
Contributor

I think it would be even better if we create a new job on travis that only runs the ci-checks.
This would mean that we could see if tests are passing even if the ci-checks are failing, while having a clear failure for the build as a whole if the ci-checks fail.

@Narretz
Copy link
Contributor Author

Narretz commented Dec 15, 2015

Ok, sounds reasonable. The only downside I see is that it will increase the average build run time by a few minutes.

@petebacondarwin
Copy link
Contributor

Not necessarily as they are run in parallel - also the ci-checks wouldn't use up tunnels as it is not doing any karma or protractor

@gkalpak
Copy link
Member

gkalpak commented Dec 15, 2015

If the ci-checks are failing it means that one of the following is happening:

  1. ddescribe-iit fails - In that case, tests passing is not that informative.
  2. merge-conflict fails - Most probably the source code is not parsable. Even if it (accidentally) is, there will need to be changes to remove the merge artifacts, so the tests might fails anyway.
  3. jshint fails - There's a chance that the tests passing is informative, but not guarranteed.

So, I am not sure we gain much 😃 jscs is the only one that is not directly related to the tests passing//failing, but that is run at the end.

Just saying...
(Either way is fine by me.)

@petebacondarwin
Copy link
Contributor

ci-checks also runs jscs.

The reason this is helpful is that when debugging it is helpful to send a commit with a ddescribe block to Travis to run just that block. But if the ddescribe test kills the build early you don't see if the test would have passed.

@Narretz
Copy link
Contributor Author

Narretz commented Dec 15, 2015

When you are working on a fix, it's also nice to see at a glance if your tests failed, or if you just made a style error.

@Narretz Narretz force-pushed the chore-travis-build branch 2 times, most recently from 04f019b to aadcf01 Compare December 15, 2015 14:23
@Narretz
Copy link
Contributor Author

Narretz commented Dec 15, 2015

I've created a new sh file which contains all the logic for the before_script block. However, I am getting this error for all jobs:

/home/travis/build.sh: line 45: ./scripts/travis/before_build.sh: Permission denied

The file isn't much different than the others. Aynone have an idea?

@gkalpak
Copy link
Member

gkalpak commented Dec 15, 2015

Could it be that directory you are trying to create ?

@Narretz Narretz force-pushed the chore-travis-build branch 2 times, most recently from 1344b85 to b22f0f0 Compare December 15, 2015 15:48
@Narretz Narretz force-pushed the chore-travis-build branch 7 times, most recently from 57f04c9 to 010eda8 Compare December 15, 2015 16:20
@Narretz
Copy link
Contributor Author

Narretz commented Dec 15, 2015

The file was created witt the wrong permissions ... I've added the new job, PTAL

@petebacondarwin
Copy link
Contributor

I was going to suggest a bit of chmod was needed :-)

@gkalpak
Copy link
Member

gkalpak commented Dec 15, 2015

LGTM

Previously, ddescribe, merge-conflicts, jshint, and jscs would run
after unit & e2e tests ran. The order was orginally changed as part of
angular#9792.

While the logic is sound that style errors shouldn't block tests from
running, ddescribe should always run. This was not guaraneteed; when
Travis exits with a warning after some browsers have run, ddescribe
doesn't get run and it doesn't become apparent that not
all tests have run.

Additionally, a separate job clearly separates style from test errors,
which e.g. means you can open a PR that includes an iit to speed up
the job, and see immediately if the test passes, because the ddescribe
error is in another job.
@petebacondarwin
Copy link
Contributor

@petebacondarwin
Copy link
Contributor

Landed as 0b94e8a

Now checking that it works on 1.2, 1.3 and 1.4

@petebacondarwin
Copy link
Contributor

Landed as

@petebacondarwin
Copy link
Contributor

Thanks @Narretz

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

Successfully merging this pull request may close these issues.

4 participants