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

fix: removed travis-specific configuration from karma.conf.js #1815

Merged
merged 1 commit into from
Aug 26, 2016

Conversation

andyskw
Copy link
Contributor

@andyskw andyskw commented Aug 23, 2016

The pull request removes the travis-specific custom launcher from karma.conf.js as per discussed in #1738.

Hopefully there will be a follow-up PR, allowing the user to successfully run their karma test cases in their CI tools, without having to change the karma.conf.js generated by angular-cli, but it still needs some investigations and decisions to be made about the approach.

@filipesilva
Copy link
Contributor

Try removing this bit as well in ./tests/e2e/e2e_workflow.spec.js:

  // In travis CI only run tests in Chrome_travis_ci
  if (process.env.TRAVIS) {
    testArgs.push('--browsers');
    testArgs.push('Chrome_travis_ci');
  }

@andyskw
Copy link
Contributor Author

andyskw commented Aug 23, 2016

I've updated it, moved the logic out to travis.yml - let's see if CI passes.

@@ -33,15 +33,6 @@ describe('Basic end-to-end Workflow', function () {

after(conf.restore);

var testArgs = ['test', '--watch', 'false'];
Copy link
Contributor

Choose a reason for hiding this comment

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

This line still needs to stay though. CI fails because it's missing, and it's what makes unit tests run in single run mode.

@andyskw andyskw force-pushed the remove_travis_custom_launcher branch from ffbec3e to 4df3a66 Compare August 24, 2016 05:57
@hansl
Copy link
Contributor

hansl commented Aug 25, 2016

Rerunning OSX Node 5, travis is having problems with their OSX VMs.

@andyskw
Copy link
Contributor Author

andyskw commented Aug 25, 2016

It's weird, it still fails on OSX, but looks like karma's chrome exits normally. Do you think it is caused by the PR, or is it just the OSX image?

@hansl
Copy link
Contributor

hansl commented Aug 25, 2016

The OSX VM are all timing out. https://www.traviscistatus.com/ says all builds are stopped.

Please rebase on top of master, I'll wait for linux and linting to pass and merge this. Thanks!

@andyskw andyskw force-pushed the remove_travis_custom_launcher branch from e25cbf6 to 6bb0254 Compare August 25, 2016 20:07
@@ -34,9 +34,11 @@ before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew tap caskroom/cask; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew cask install google-chrome --force; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then echo "--no-sandbox" > ~/.config/chrome-flags.conf; fi
Copy link
Contributor Author

Choose a reason for hiding this comment

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

After the rebase i've also added no sandbox to osx, maybe it fixes the issue.

@andyskw andyskw force-pushed the remove_travis_custom_launcher branch from 6bb0254 to fe5e786 Compare August 26, 2016 07:16
…r not to favor any particular CI tool over others.
@andyskw andyskw force-pushed the remove_travis_custom_launcher branch from fe5e786 to 0c7fdb8 Compare August 26, 2016 07:17
@andyskw
Copy link
Contributor Author

andyskw commented Aug 26, 2016

Rebased, and also edited the script in travis.yml, which adds --no-sandbox flag to chrome. With the new version in hand, the script creates the ~/.config directory explicitly. Now it seems to be stable.

@filipesilva filipesilva merged commit f03f275 into angular:master Aug 26, 2016
@filipesilva
Copy link
Contributor

It's in! Thanks so much for this @andyskw, I think I might use your technique the next time I setup travis on other repos. It's just really clean!

@andyskw andyskw deleted the remove_travis_custom_launcher branch August 26, 2016 15:08
@andyskw
Copy link
Contributor Author

andyskw commented Aug 26, 2016

I'm happy if it helped, thanks for the effort and for the merge!

On the other hand, the generated ng2 projects still wont work with CI-s, since karma's autowatch is enabled there. Karma will be able to start (with the proper CI config in hand), but it will never stop running.

If we could tell the karma config somehow dynamically, that the context is a CI environment, we could disable autowatch (or enable singleRun, doesn't matter) without having to make any changes in the generated project.

Do you think it worth the effort? If so, I'd be happy to give a PR, which waits for an environment variable (CONTEXT_CI maybe?), and based on the existence of that variable, it overrides the default karma configuration.

With that one, the angular 2 app developer only has to add an export CONTEXT_CI=true in the .travis.yml/teamcity build config/jenkins blabla..., and it just works.

What do you think?

@filipesilva
Copy link
Contributor

I suppose that would work, but you can also do ng test --watch=false in the CI to run your tests, can't you? That's what we do in the CLI CI to get the generated project to run it's tests.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants