Skip to content

Commit

Permalink
Merge pull request #125 from onozaty/fix-circleci-test
Browse files Browse the repository at this point in the history
Fix CircleCI test
  • Loading branch information
onozaty authored Feb 11, 2025
2 parents 6e72e94 + 8a8ac0d commit 2bb5cdc
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 20 deletions.
23 changes: 14 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

orbs:
redmine-plugin: agileware-jp/redmine-plugin@3.6.0
redmine-plugin: agileware-jp/redmine-plugin@3.8.0

jobs:
run_tests:
Expand All @@ -14,7 +14,7 @@ jobs:
default: redmine
ruby_version:
type: string
default: "3.2" # https://github.com/redmine/redmine/blob/5.1.0/Gemfile#L3
default: "3.3" # https://github.com/redmine/redmine/blob/5.0.3/Gemfile#L3
database:
type: enum
enum:
Expand Down Expand Up @@ -62,18 +62,23 @@ workflows:
test:
jobs:
- run_tests:
name: latest Redmine (5.1) with PostgreSQL
name: latest Redmine with PostgreSQL
database: pg
- run_tests:
name: latest Redmine (5.1) with MySQL
name: latest Redmine with MySQL
database: mysql
- run_tests:
name: redmine-4.2 with PostgreSQL
redmine_version: "4.2.10"
ruby_version: "2.7" # https://github.com/redmine/redmine/blob/4.2.10/Gemfile#L3
name: redmine-5.1.6 with PostgreSQL
redmine_version: "5.1.6"
ruby_version: "3.2" # https://github.com/redmine/redmine/blob/5.1.6/Gemfile#L3
database: pg
- run_tests:
name: redmine-5.0.11 with PostgreSQL
redmine_version: "5.0.11"
ruby_version: "3.1" # https://github.com/redmine/redmine/blob/5.0.11/Gemfile#L3
database: pg
- run_tests:
name: redmine-4.2 with MySQL
name: redmine-4.2 with PostgreSQL
redmine_version: "4.2.10"
ruby_version: "2.7" # https://github.com/redmine/redmine/blob/4.2.10/Gemfile#L3
database: mysql
database: pg
8 changes: 8 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM redmine:6.0.3

# 必要なパッケージをインストール
RUN apt-get update && apt-get install -y \
build-essential \
libssl-dev \
libreadline-dev \
zlib1g-dev
16 changes: 16 additions & 0 deletions .devcontainer/database.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
production:
adapter: postgresql
host: "db"
port: "5432"
username: "postgres"
password: "example"
database: "postgres"
encoding: "utf8"
test:
adapter: postgresql
host: "db"
port: "5432"
username: "postgres"
password: "example"
database: "test"
encoding: "utf8"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE DATABASE test;
GRANT ALL PRIVILEGES ON DATABASE test TO postgres;
15 changes: 15 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "Redmine",
"dockerComposeFile": "docker-compose.yml",
"service": "redmine",
"remoteUser": "redmine",
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.defaultProfile.linux": "bash"
}
}
},
"workspaceFolder": "/usr/src/redmine/plugins/view_customize",
"postCreateCommand": "cd /usr/src/redmine && bundle config set without development && bundle install --verbose && bundle exec rails db:migrate:reset RAILS_ENV=test && bundle exec rake redmine:plugins:migrate RAILS_ENV=production && bundle exec rake redmine:plugins:migrate RAILS_ENV=test"
}
27 changes: 27 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
services:
redmine:
build:
context: .
dockerfile: Dockerfile
restart: always
ports:
- 8080:3000
environment:
REDMINE_DB_POSTGRES: db
REDMINE_DB_PASSWORD: example
volumes:
- redmine-files:/usr/src/redmine/files
- ./database.yml:/usr/src/redmine/config/database.yml
- ./..:/usr/src/redmine/plugins/view_customize
db:
image: postgres:latest
restart: unless-stopped
volumes:
- postgres-data:/var/lib/postgresql/data
- ./db/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
environment:
POSTGRES_PASSWORD: example
POSTGRES_DB: redmine
volumes:
redmine-files:
postgres-data:
10 changes: 0 additions & 10 deletions Vagrantfile

This file was deleted.

9 changes: 8 additions & 1 deletion test/unit/view_customize_view_hook_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,16 @@ def test_view_layouts_base_html_head

expected = Regexp.escape("\n")
expected << Regexp.escape("<!-- [view customize plugin] path:/issues -->\n")
expected << "("
expected << Regexp.escape("<link rel=\"stylesheet\" media=\"screen\" href=\"/plugin_assets/view_customize/stylesheets/view_customize.css?")
expected << "[0-9]+"
expected << Regexp.escape("\" /><script type=\"text/javascript\">\n")
expected << Regexp.escape("\" />")
expected << "|"
expected << Regexp.escape("<link rel=\"stylesheet\" href=\"/assets/plugin_assets/view_customize/view_customize-")
expected << "[0-9a-z]+"
expected << Regexp.escape(".css\" media=\"screen\" />")
expected << ")"
expected << Regexp.escape("<script type=\"text/javascript\">\n")
expected << Regexp.escape("//<![CDATA[\n")
expected << Regexp.escape("ViewCustomize = { context: {\"user\":{\"id\":1,\"login\":\"admin\",\"admin\":true,\"firstname\":\"Redmine\",\"lastname\":\"Admin\",\"mail\":\"admin@somenet.foo\",\"lastLoginOn\":\"2006-07-19T20:57:52Z\",\"groups\":[],\"apiKey\":null,\"customFields\":[{\"id\":4,\"name\":\"Phone number\",\"value\":null},{\"id\":5,\"name\":\"Money\",\"value\":null}]},\"project\":{\"id\":1,\"identifier\":\"ecookbook\",\"name\":\"eCookbook\",\"roles\":[{\"id\":4,\"name\":\"Non member\"}],\"customFields\":[{\"id\":3,\"name\":\"Development status\",\"value\":\"Stable\"}]}} };\n")
expected << Regexp.escape("//]]>\n")
Expand Down

0 comments on commit 2bb5cdc

Please sign in to comment.