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

Added phpunit to dev dependencies #83

Merged
merged 1 commit into from Feb 26, 2015
Merged

Added phpunit to dev dependencies #83

merged 1 commit into from Feb 26, 2015

Conversation

assertchris
Copy link
Contributor

No description provided.

@dhensby
Copy link
Contributor

dhensby commented Feb 26, 2015

Personally, I think this makes sense.

But given these comments silverstripe/silverstripe-framework#3104 (comment) there is a reason that it isn't currently included.

@silverstripe/core-team any new thoughts on this?

@dhensby
Copy link
Contributor

dhensby commented Feb 26, 2015

PS: we only need this once and can merge it up into the other branches ourselves if needed

@assertchris
Copy link
Contributor Author

Just wanted to avoid any hassles by making one for each major/minor... :)

@tractorcow
Copy link

2.4 is still a think? I thought I deleted that branch. Oh well. :)

tractorcow pushed a commit that referenced this pull request Feb 26, 2015
…v-dependencies

Added phpunit to dev dependencies
@tractorcow tractorcow merged commit e89f5fe into silverstripe:2.4 Feb 26, 2015
@dhensby
Copy link
Contributor

dhensby commented Feb 26, 2015

@assertchris appreciated, thanks. I just wanted to save YOU the hassle!

@assertchris assertchris deleted the feature/2.4/add-phpunit-to-dev-dependencies branch February 26, 2015 01:31
@assertchris
Copy link
Contributor Author

@dhensby it's no trouble. Happy to help!

@chillu
Copy link
Member

chillu commented Feb 26, 2015

I've agreed with this changed a year ago in silverstripe/silverstripe-framework#3104 (comment) (just reminding myself mostly hehe).

What do you guys think about using composer create-project --no-dev on http://www.silverstripe.org/software/download/? My concern is that the first experience for users is now slowed down even more by composer pulling down dev dependencies which first time installers are unlikely to use.

@stevie-mayhew
Copy link
Contributor

@chillu I would even go as far as to recommend composer create-project --no-dev --prefer-dist

@dhensby
Copy link
Contributor

dhensby commented Feb 26, 2015

I think there's a trade off between getting someone's initial project creation / dev environment running in a way that we reduce friction to writing and executing tests and getting it set up as quickly as possible.

If we explain what the flags are for and why as well as directing people to the docs for creating a project for SS patches, then we can instruct them however we like, I suppose.

I agree that the provided package on the dowload page should not be including dev deps.

@chillu
Copy link
Member

chillu commented Feb 26, 2015

@tractorcow @camfindlay @unclecheese Would you be able to check out the create-project suggestion above, and determine if we can add it to silverstripe.org/download? I've timed it on my ~10Mbit connection at home (with an rm -rf ~/.composer/cache), and its 30% slower since this change has been merged in (using 3.1.x-dev with --prefer-dist to emulate checking out a tag).

Before:

time composer create-project --no-dev --prefer-dist silverstripe/installer project2 3.1.x-dev
Installing silverstripe/installer (3.1.x-dev 38ee2f9a1d91feb6e2506c85958328930906eee8)
  - Installing silverstripe/installer (3.1.x-dev 38ee2f9)
    Downloading: 100%

Created project in project2
Loading composer repositories with package information
Installing dependencies
  - Installing composer/installers (dev-master d64e23f)
    Downloading: 100%

  - Installing silverstripe/framework (3.1.x-dev 773624a)
    Downloading: 100%

  - Installing silverstripe/cms (3.1.x-dev c7814cf)
    Downloading: 100%

  - Installing silverstripe-themes/simple (dev-master 63c549e)
    Downloading: 100%

Writing lock file
Generating autoload files

real    2m27.034s
user    0m3.414s
sys 0m2.110s

After:

time composer create-project --prefer-dist silverstripe/installer project1 3.1.x-dev
Installing silverstripe/installer (3.1.x-dev 38ee2f9a1d91feb6e2506c85958328930906eee8)
  - Installing silverstripe/installer (3.1.x-dev 38ee2f9)
    Downloading: 100%

Created project in project1
Loading composer repositories with package information
Installing dependencies (including require-dev)
  - Installing composer/installers (dev-master d64e23f)
    Downloading: 100%

  - Installing silverstripe/framework (3.1.x-dev 773624a)
     Downloading: 100%

  - Installing silverstripe/cms (3.1.x-dev c7814cf)
    Downloading: 100%

  - Installing silverstripe-themes/simple (dev-master 63c549e)
    Downloading: 100%

  - Installing symfony/yaml (2.7.x-dev d04b392)
    Downloading: 100%

  - Installing phpunit/php-text-template (1.2.0)
    Downloading: 100%

  - Installing phpunit/phpunit-mock-objects (1.2.x-dev c39c451)
    Downloading: 100%

  - Installing phpunit/php-timer (1.0.5)
    Downloading: 100%

  - Installing phpunit/php-token-stream (1.2.2)
    Downloading: 100%

  - Installing phpunit/php-file-iterator (1.3.4)
    Downloading: 100%

  - Installing phpunit/php-code-coverage (1.2.x-dev fe24668)
    Downloading: 100%

  - Installing phpunit/phpunit (3.7.38)
    Downloading: 100%

phpunit/php-code-coverage suggests installing ext-xdebug (>=2.0.5)
phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)
Writing lock file
Generating autoload files

real    3m24.262s
user    0m5.368s
sys 0m2.562s

@camfindlay
Copy link

I think it would be good to have less to install to start with so would be happy adding the --no-dev flag etc to the download page as long as someone can update the installation documentation to explain why and what happens if you omit these flags. Get those docs in first and I'll make arrangements to update silverstripe.org content to match.

Do we have numbers on improvements if --prefer-dist is included too. Need to balance keeping it simple with keeping it speedy. (Anyone know what other composer frameworks say on first install?).

@assertchris
Copy link
Contributor Author

@camfindlay you say "other composer frameworks" like this is one...

:trollface:

@camfindlay
Copy link

I mean, what do other frameworks that use composer mention in their docs when it comes to installation via composer? We want newcomers to get into using composer, we also don't want to scare them away so we should provide good information :)

@camfindlay
Copy link

Fyi, the slowness of composer installing SilverStripe regularly comes up whenever I've run training courses. (Still, it's faster then manually dealing with dependancies!). @assertchris what's your position on this? Should a new dev always get dev tools by default or should they be introduced to them so they know what they're getting and can make the choice to run a composer update to get them after initial install?

@camfindlay
Copy link

I can confirm a good minute+ improvement using @chillu 's method above:

Before:

time composer create-project --prefer-dist silverstripe/installer project1 3.1.x-dev
Installing silverstripe/installer (3.1.x-dev 38ee2f9a1d91feb6e2506c85958328930906eee8)
  - Installing silverstripe/installer (3.1.x-dev 38ee2f9)
    Downloading: 100%         

Created project in project1
Loading composer repositories with package information
Installing dependencies (including require-dev)
  - Installing composer/installers (dev-master d64e23f)
    Downloading: 100%         

  - Installing silverstripe/framework (3.1.x-dev 773624a)
    Downloading: 100%         

  - Installing silverstripe/cms (3.1.x-dev c7814cf)
    Downloading: 100%         

  - Installing silverstripe-themes/simple (dev-master 63c549e)
    Downloading: 100%         

  - Installing symfony/yaml (2.7.x-dev d04b392)
    Downloading: 100%         

  - Installing phpunit/php-text-template (1.2.0)
    Downloading: 100%         

  - Installing phpunit/phpunit-mock-objects (1.2.x-dev c39c451)
    Downloading: 100%         

  - Installing phpunit/php-timer (1.0.5)
    Downloading: 100%         

  - Installing phpunit/php-token-stream (1.2.2)
    Downloading: 100%         

  - Installing phpunit/php-file-iterator (1.3.4)
    Downloading: 100%         

  - Installing phpunit/php-code-coverage (1.2.x-dev fe24668)
    Downloading: 100%         

  - Installing phpunit/phpunit (3.7.38)
    Downloading: 100%         

phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)
Writing lock file
Generating autoload files

real    4m29.561s
user    0m8.136s
sys 0m2.691s

After:

time composer create-project --no-dev --prefer-dist silverstripe/installer project2 3.1.x-dev
Installing silverstripe/installer (3.1.x-dev 38ee2f9a1d91feb6e2506c85958328930906eee8)
  - Installing silverstripe/installer (3.1.x-dev 38ee2f9)
    Downloading: 100%         

Created project in project2
Loading composer repositories with package information
Installing dependencies
  - Installing composer/installers (dev-master d64e23f)
    Downloading: 100%         

  - Installing silverstripe/framework (3.1.x-dev 773624a)
    Downloading: 100%         

  - Installing silverstripe/cms (3.1.x-dev c7814cf)
    Downloading: 100%         

  - Installing silverstripe-themes/simple (dev-master 63c549e)
    Downloading: 100%         

Writing lock file
Generating autoload files

real    3m6.989s
user    0m4.008s
sys 0m1.940s

Guess the key question here is... is it worth a minute of time to ensure a dev has dev tools installed? (and how many minutes might it be on a lesser computer?)

@assertchris
Copy link
Contributor Author

@camfindlay there are different concerns at play. New "users" don't need the extra install time. New "contributors" need to be able to test quickly.

Having just spent time setting up my first SS framework contribution environment (I still can't run phpunit against upstream/3) I have some first-hand experience with how difficult it is for new "contributors" to start.

So I think you're on the money about documenting the differences on /download and removing unused dependencies for "users". But I also feel like it shouldn't be this hard to contribute (which, for non-trivial contribution, means being able to test easily)...

@camfindlay
Copy link

@assertchris yip agree getting set up to contribute should be simple.

So are we in agreement that the default copy/paste composer command on the /downloads page of silverstripe.org should include the --no-dev flag and we should make mention in the docs about what to do next if you want to get the dev tools?

@camfindlay
Copy link

Also just for fun and statistics... I'm running the documented composer create-projects of a couple of other frameworks to get a comparative time to getting all the things vs SilverStripe things. Post the results shortly.

@camfindlay
Copy link

time composer create-project symfony/framework-standard-edition my_project_name
...
real    5m15.348s
user    0m7.475s
sys 0m3.479s

and

time composer create-project laravel/laravel your-project-name --prefer-dist
...
real    7m43.518s
user    0m24.825s
sys 0m3.512s

So actually even including our dev tools we are still pretty fast in comparison

I also wonder whether we should change the /path/to/project in that copy and paste on the download page so that it is actually a pure copy/paste process?

@assertchris
Copy link
Contributor Author

@camfindlay Our project is slow because there's lots to download. Others are slow because there's a big dependency graph to work out.

It doesn't make much difference except that modular structure is quantifiably better. Different thread though...

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

Successfully merging this pull request may close these issues.

None yet

6 participants