gtt-project / redmine_gtt

Plugin that adds spatial capabilities to Redmine
GNU General Public License v3.0
16 stars 5 forks source link

Test fails with missing projects/users/issues tables on Redmine 4.2 environment #147

Closed sanak closed 2 years ago

sanak commented 2 years ago

Problem Plugin migrate seems to be failed on Redmine 4.2 environment

To Reproduce

% git clone git@github.com:redmine/redmine.git -b 4.2-stable redmine42
# set config/database.yml
% cd redmine42/plugins
% git clone git@github.com:gtt-project/redmine_gtt.git
% cd redmine_gtt
% yarn
% npx webpack
% cd ../../
% export GEM_RGEO_ACTIVERECORD_VERSION=6.2.2
% export GEM_ACTIVERECORD_POSTGIS_ADAPTER_VERSION=5.2.3
% bundle install
% bundle exec rake db:create
% bundle exec rake db:migrate
% bundle exec rake redmine:plugins:migrate
:
unknown OID 1829095: failed to recognize type of 'geom'. It will be treated as String.
% bundle exec rake redmine:plugins:test RAILS_ENV=test NAME=redmine_gtt
Run options: --seed 34599

# Running:

.E

Error:
UpdateProjectTest#test_should_add_default_tile_source_if_module_is_enabled:
RuntimeError: Wrapped undumpable exception for: ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR:  relation "projects" does not exist
LINE 8:                WHERE a.attrelid = '"projects"'::regclass
                                          ^
:               SELECT a.attname, format_type(a.atttypid, a.atttypmod),
                     pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod,
                     c.collname, col_description(a.attrelid, a.attnum) AS comment
                FROM pg_attribute a
                LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum
                LEFT JOIN pg_type t ON a.atttypid = t.oid
                LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation
               WHERE a.attrelid = '"projects"'::regclass
                 AND a.attnum > 0 AND NOT a.attisdropped
               ORDER BY a.attnum

    plugins/redmine_gtt/test/unit/update_project_test.rb:9:in `block in <class:UpdateProjectTest>'

bin/rails test plugins/redmine_gtt/test/unit/update_project_test.rb:5
:

From the error messages, projects and users tables seem to be missing, and I couldn't find those tables with issues table from psql command.

% psql -U gtt redmine42_build_test
\d

=> projects, users and issues tables are missing.

Expectation projects, users and issues tables should exist during test.

sanak commented 2 years ago

I missed to change database.yml - adapter from postgresql to postgis which is also described in README.md... I close this.