mrdavidlaing / pressupbox-development-boilerplate

Patterns and practices for teams to collaborating on WordPress projects
Other
1 stars 5 forks source link

Create test database on dev-server #9

Closed daithi-coombes closed 11 years ago

daithi-coombes commented 11 years ago

Install a test database for wordpress to populate the blog. See issue #4

some test data at: https://wpcom-themes.svn.automattic.com/demo/theme-unit-test-data.xml

daithi-coombes commented 11 years ago

@mrdavidlaing currently I'm going to try importing the test data using the Vagrant file here https://github.com/mrdavidlaing/pressupbox-development-boilerplate/blob/test-database/Vagrantfile#L51

Where are the mysql tables defined? It may be best to import the test data there. I've looked in the vagrant file and grunt but can't find it.

daithi-coombes commented 11 years ago

sorry, the call for the db actions are in the grunt file development-boilerplate/blob/test-database/Gruntfile.js#L97

so will put them there for now, the shell command can then be coppied/pasted to rake.

mrdavidlaing commented 11 years ago

The db gets created in the dev-server grunt task, so you should stick the db restore steps there - https://github.com/mrdavidlaing/pressupbox-development-boilerplate/blob/master/Gruntfile.js#L96

mrdavidlaing commented 11 years ago

Just seen your comment - we're talking about the same place :)

mrdavidlaing commented 11 years ago

@daithi-coombes - do you have an ETA for this to be completed?

daithi-coombes commented 11 years ago

getting started on it as we speak. I hope to have it up and tested by noon today

mrdavidlaing commented 11 years ago

@daithi-coombes Also, I noticed that some of the galleries seem to be missing images eg: http://localhost:4567/?p=555 refers to wp-content/uploads/2011/01/canola2-624x468.jpg which we obviously don't have.

Could you get hold of those files and dump them into /tests/wp-content/uploads/... - the setup-test-database task could test just copy them into the right place.

daithi-coombes commented 11 years ago

@mrdavidlaing

perfect example of my comment earlier that I couldn't commit changes I made to the build scripts inside the vm. I imported the sql dump in the 'dev-server' task using phing's build.xml, so my dev-server task in build xml now looks like...

    <!-- setup dev server -->
    <target name="dev-server">
        <taskdef name="pdosqlexec" classname="phing.tasks.ext.pdo.PDOSQLExecTask"/>
        <trycatch>
            <try>
                <pdosqlexec url="mysql:host=localhost"
                        userid="root"
                        password="secret_password"
                        onerror="abort"
                        autocommit="true">
                    CREATE DATABASE wordpress;
                </pdosqlexec>
            </try>
            <catch>
            </catch>
            <finally>
                <exec command="mysql -uroot -psecret_password -h localhost wordpress &lt; wordpress.sample.sql" />
            </finally>
        </trycatch>
    </target>
    <!-- end setup dev server -->

but this will be moved to rake tonight ;)

no prob, I'll find the missing files and commit them.

just thinking that maybe we should have another point for our next meeting (or sooner), that any build scripts, init scripts or init files that are needed by the vm should be in a folder in the pressupbox repository, that way contributers to pressupbox can submit commits to the build scripts etc?

mrdavidlaing commented 11 years ago

I'm going to merge this PR to get the basic features already implemented.

The additional features @daithi-coombes is proposing can be rolled into the #24 - Rewrite build script in Rake