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

E2EテストのタイムゾーンをPHPに合わせる #883

Merged
merged 5 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ jobs:
OWNER: ${{ inputs.owner }}
DB: ${{ matrix.db }}
PHP: ${{ matrix.php }}
PATTERN: ${{ matrix.pattern }}
GROUP: ${{ matrix.group }}
run: |
echo "COMPOSE_FILE=docker-compose.yml:docker-compose.${DB}.yml:docker-compose.dev.yml:docker-compose.owaspzap.yml:docker-compose.owaspzap.daemon.yml" >> $GITHUB_ENV
echo "IMAGE_NAME=${OWNER,,}/ec-cube2-php" >> $GITHUB_ENV
Expand All @@ -64,6 +66,8 @@ jobs:
else
echo "TAG=${PHP}-apache-${REF_NAME}" >> $GITHUB_ENV
fi
echo "PATTERN=${PATTERN//:/-}" >> $GITHUB_ENV
echo "GROUP=${GROUP//\//-}" >> $GITHUB_ENV
- if: matrix.pattern == 'test:e2e-extends'
run: cp -rp tests/class/fixtures/page_extends/* data/class_extends/page_extends

Expand Down Expand Up @@ -105,13 +109,13 @@ jobs:
if: failure()
uses: actions/upload-artifact@v4
with:
name: linux-php${{ matrix.tag }}-${{ matrix.db }}-evidence
name: linux-php${{ matrix.php }}-${{ matrix.db }}-${{ env.PATTERN }}-${{ env.GROUP }}-evidence
path: 'test-results/'
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: linux-php${{ matrix.php }}-${{ matrix.db }}-logs
name: linux-php${{ matrix.php }}-${{ matrix.db }}-${{ env.PATTERN }}-${{ env.GROUP }}-logs
path: data/logs
installer:
name: Installer test
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ services:

mysql:
image: mysql:5.7
command: mysqld --character-set-server=utf8 --collation-server=utf8_general_ci
command: mysqld --character-set-server=utf8 --collation-server=utf8_general_ci --default-time-zone=+09:00
ports:
- '13306:3306'
volumes:
- mysql-database:/var/lib/mysql
environment:
TZ: Asia/Tokyo
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: eccube_db
MYSQL_USER: eccube_db_user
Expand Down
1 change: 1 addition & 0 deletions docker-compose.pgsql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ services:
postgres:
image: postgres
environment:
- TZ=Asia/Tokyo
- POSTGRES_DB=eccube_db
- POSTGRES_USER=eccube_db_user
- POSTGRES_PASSWORD=password
Expand Down
4 changes: 3 additions & 1 deletion e2e-tests/test/admin/total/total.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { test, expect, chromium, Page } from '@playwright/test';
import { ZapClient, Mode, ContextType } from '../../../utils/ZapClient';
import { toZonedTime } from 'date-fns-tz';

import fs from 'fs/promises';

import { ADMIN_DIR } from '../../../config/default.config';
Expand All @@ -25,7 +27,7 @@ test.describe.serial('売上集計画面を確認をします', () => {
await page.goto(url);
});

const current = new Date();
const current = toZonedTime(new Date(), 'Asia/Tokyo');
test.describe('期間別集計の確認をします', () => {
const method = 'term';
test('期間別集計画面を開きます', async () => {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"@babel/polyfill": "^7.12.1",
"css-loader": "^6.10.0",
"date-fns": "^3.6.0",
"date-fns-tz": "^3.0.0",
"jquery": "3",
"jquery-colorbox": "^1.6.4",
"jquery-easing": "^0.0.1",
Expand Down
45 changes: 40 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1442,16 +1442,23 @@ acorn-jsx@^5.3.2:
version "5.3.2"
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937"
integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==

acorn@^8.7.1, acorn@^8.8.2, acorn@^8.9.0:
version "8.11.3"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a"
integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==

ajv-formats@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/ajv-formats/-/ajv-formats-2.1.1.tgz#6e669400659eb74973bbf2e33327180a0996b520"
integrity sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==
dependencies:
ajv "^8.0.0"
acorn@^8.7.1, acorn@^8.8.2, acorn@^8.9.0:
version "8.11.3"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a"
integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==

ajv-keywords@^3.5.2:
version "3.5.2"
resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d"
integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==

ajv-keywords@^5.1.0:
version "5.1.0"
Expand Down Expand Up @@ -1904,6 +1911,13 @@ dashdash@^1.12.0:
dependencies:
assert-plus "^1.0.0"

date-fns-tz@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/date-fns-tz/-/date-fns-tz-3.0.0.tgz#0559cd6a1aa8eca1d140f1682ad7f0e77429c13e"
integrity sha512-YgRowJwvCAAjN1A5F2l1ZjnYKThX7YDq399qo+ThXFpeOqinN1u8SUqfM5IdRQSpai18Iy3EBMb6/CXTSnDstg==
dependencies:
lodash.clonedeep "^4.5.0"

date-fns@*, date-fns@^3.6.0:
version "3.6.0"
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-3.6.0.tgz#f20ca4fe94f8b754951b24240676e8618c0206bf"
Expand Down Expand Up @@ -3076,6 +3090,11 @@ locate-path@^7.1.0:
dependencies:
p-locate "^6.0.0"

lodash.clonedeep@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef"
integrity sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==

lodash.debounce@^4.0.8:
version "4.0.8"
resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
Expand Down Expand Up @@ -3391,6 +3410,13 @@ picomatch@^2.2.3:
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==

pkg-dir@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3"
integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==
dependencies:
find-up "^4.0.0"

pkg-dir@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-7.0.0.tgz#8f0c08d6df4476756c5ff29b3282d0bab7517d11"
Expand Down Expand Up @@ -3706,6 +3732,15 @@ safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0:
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==

schema-utils@^3.0.0, schema-utils@^3.1.1, schema-utils@^3.2.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.3.0.tgz#f50a88877c3c01652a15b622ae9e9795df7a60fe"
integrity sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==
dependencies:
"@types/json-schema" "^7.0.8"
ajv "^6.12.5"
ajv-keywords "^3.5.2"

schema-utils@^4.0.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.2.0.tgz#70d7c93e153a273a805801882ebd3bff20d89c8b"
Expand All @@ -3716,7 +3751,7 @@ schema-utils@^4.0.0:
ajv-formats "^2.1.1"
ajv-keywords "^5.1.0"

semver@^6.0.0, semver@^6.3.1:
semver@^6.3.1:
version "6.3.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4"
integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==
Expand Down
2 changes: 1 addition & 1 deletion zap/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM owasp/zap2docker-stable
FROM ghcr.io/zaproxy/zaproxy:stable

USER root
RUN apt-get update \
Expand Down
Loading