Skip to content
This repository

[travis ci] Further improvements #988

Merged
merged 3 commits into from almost 2 years ago

3 participants

DaSourcerer Alexander Makarov resurtm
DaSourcerer

Some more travis goodness:

  • MS-SQL tests are no longer run (i.e. they won't be picked up instead of just being skipped).
  • CDbAuthManagerTest will now use the auth schema file found in framework/web/auth/
DaSourcerer

Short preview: http://travis-ci.org/#!/DaSourcerer/yii/jobs/1880847
No more skipped tests :)

Alexander Makarov samdark commented on the diff
.travis.yml
@@ -14,4 +14,4 @@ before_script:
14 14 - echo 'y' | pecl install memcache > ~/memcache.log || ( echo "=== MEMCACHE BUILD FAILED ==="; cat ~/memcache.log )
15 15 - echo "extension=memcache.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
16 16
17   -script: phpunit --colors --coverage-text framework
  17 +script: phpunit --colors --coverage-text --exclude-group mssql framework
6
Alexander Makarov Collaborator
samdark added a note

Is there a way to actually run these?

DaSourcerer
DaSourcerer added a note

Currently no. MS-SQL is not part of the travis environment.

DaSourcerer
DaSourcerer added a note

After some additional research: Installing MS-SQL on Linux is still difficult and close to impossible. The most accepted way seems to install a Windows VM, install MS SQL Server on it and connect through that. Frankly, I do not see this happening soon for Travis CI. Unless we open a MS SQL Server instance somewhere else to Travis, these tests will see no attention through the automated testruns.

resurtm Collaborator
resurtm added a note

@DaSourcerer But is there any information about plans on MSSQL? They have decided not to implement it at all?

resurtm Collaborator
resurtm added a note

There is an existing issue: travis-ci/travis-ci#216
There are chances for obtaining MSSQL support. :)

@resurtm: Whoa, that comes at the price of switching the underlying OS. I'll keep an eye on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Alexander Makarov samdark merged commit beecbe5 into from
Alexander Makarov samdark closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
2  .travis.yml
@@ -14,4 +14,4 @@ before_script:
14 14 - echo 'y' | pecl install memcache > ~/memcache.log || ( echo "=== MEMCACHE BUILD FAILED ==="; cat ~/memcache.log )
15 15 - echo "extension=memcache.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
16 16
17   -script: phpunit --colors --coverage-text framework
  17 +script: phpunit --colors --coverage-text --exclude-group mssql framework
4 tests/framework/db/schema/CMssqlTest.php
@@ -3,7 +3,9 @@
3 3 Yii::import('system.db.CDbConnection');
4 4 Yii::import('system.db.schema.mysql.CMssqlSchema');
5 5
6   -
  6 +/**
  7 + * @group mssql
  8 + */
7 9 class CMssqlTest extends CTestCase
8 10 {
9 11 const DB_HOST='YII'; // This is the alias to mssql server. Defined in freetds.conf for linux, or in Client Network Utility on windows
7 tests/framework/web/auth/CDbAuthManagerTest.php
@@ -11,7 +11,7 @@ public function setUp()
11 11 if(!extension_loaded('pdo') || !extension_loaded('pdo_pgsql'))
12 12 $this->markTestSkipped('PDO and PostgreSQL extensions are required.');
13 13
14   - $schemaFile=realpath(dirname(__FILE__).'/schema.sql');
  14 + $schemaFile=realpath(Yii::getPathOfAlias('system.web.auth.schema-pgsql').'.sql');
15 15
16 16 $this->db=new CDbConnection('pgsql:host=localhost;dbname=yii','test','test');
17 17 try
@@ -23,7 +23,7 @@ public function setUp()
23 23 $this->markTestSkipped("Please read $schemaFile for details on setting up the test environment for PostgreSQL test case.");
24 24 }
25 25
26   - $sqls=file_get_contents($schemaFile);
  26 + $sqls=preg_replace('/\/\*.*\*\//s', '', file_get_contents($schemaFile));
27 27 foreach(explode(';',$sqls) as $sql)
28 28 {
29 29 if(trim($sql)!=='')
@@ -32,9 +32,6 @@ public function setUp()
32 32 $this->db->active=false;
33 33
34 34 $this->auth=new CDbAuthManager;
35   - $this->auth->assignmentTable = 'authassignment';
36   - $this->auth->itemChildTable = 'authitemchild';
37   - $this->auth->itemTable = 'authitem';
38 35 $this->auth->db=$this->db;
39 36 $this->auth->init();
40 37 $this->prepareData();
32 tests/framework/web/auth/schema.sql
... ... @@ -1,32 +0,0 @@
1   -drop table if exists authassignment cascade;
2   -drop table if exists authitemchild cascade;
3   -drop table if exists authitem cascade;
4   -
5   -create table authitem
6   -(
7   - name varchar(64) not null,
8   - type integer not null,
9   - description text,
10   - bizrule text,
11   - data text,
12   - primary key (name)
13   -);
14   -
15   -create table authitemchild
16   -(
17   - parent varchar(64) not null,
18   - child varchar(64) not null,
19   - primary key (parent,child),
20   - foreign key (parent) references authitem (name) on delete cascade on update cascade,
21   - foreign key (child) references authitem (name) on delete cascade on update cascade
22   -);
23   -
24   -create table authassignment
25   -(
26   - itemname varchar(64) not null,
27   - userid varchar(64) not null,
28   - bizrule text,
29   - data text,
30   - primary key (itemname,userid),
31   - foreign key (itemname) references authitem (name) on delete cascade on update cascade
32   -);

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.