Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
e24d7720
Unverified
Commit
e24d7720
authored
Sep 08, 2023
by
OptimismBot
Committed by
GitHub
Sep 08, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7152 from ethereum-optimism/wyatt/ufm/metamask-send-tx-test-docker
Metamask send tx test Docker support
parents
753a1973
177e79d9
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
13 deletions
+38
-13
.env.example
ufm-test-services/.env.example
+6
-3
docker-compose.yml
ufm-test-services/docker-compose.yml
+14
-1
Dockerfile
ufm-test-services/metamask/Dockerfile
+11
-4
package.json
ufm-test-services/metamask/package.json
+1
-1
playwright.config.ts
ufm-test-services/metamask/playwright.config.ts
+1
-1
start.sh
ufm-test-services/metamask/start.sh
+3
-1
metamask.spec.ts
ufm-test-services/metamask/tests/metamask.spec.ts
+2
-2
No files found.
ufm-test-services/.env.example
View file @
e24d7720
...
@@ -2,6 +2,9 @@ CI=false
...
@@ -2,6 +2,9 @@ CI=false
GRAFANA_ADMIN_PWD=
GRAFANA_ADMIN_PWD=
# Used to set the display to be used by playwright when running Metamask test service
# Used to set the display to be used by playwright when running Metamask test service.
MM_DISPLAY=host.docker.internal:0
# The following are to be used if running on MacOS
MM_DISPLAY_VOLUME=/tmp/.X11-unix:/tmp/.X11-unix
# MM_DISPLAY=host.docker.internal:0
\ No newline at end of file
# MM_DISPLAY_VOLUME=/tmp/.X11-unix:/tmp/.X11-unix
MM_DISPLAY=
MM_DISPLAY_VOLUME=
ufm-test-services/docker-compose.yml
View file @
e24d7720
...
@@ -35,10 +35,23 @@ services:
...
@@ -35,10 +35,23 @@ services:
environment
:
environment
:
-
GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PWD}
-
GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PWD}
volumes
:
volumes
:
-
./dat
e
sources.yml:/etc/grafana/provisioning/datasources/datasources.yaml
-
./dat
a
sources.yml:/etc/grafana/provisioning/datasources/datasources.yaml
security_opt
:
security_opt
:
-
"
no-new-privileges:true"
-
"
no-new-privileges:true"
metamask
:
build
:
./metamask
container_name
:
test-service-metamask
profiles
:
[
"
30minute"
]
depends_on
:
-
prometheus
environment
:
DISPLAY
:
${MM_DISPLAY:-:0}
CI
:
${CI:-true}
volumes
:
-
${MM_DISPLAY_VOLUME}
restart
:
no
# Example Test Service Config
# Example Test Service Config
# my_test_service:
# my_test_service:
# build: ./my_test_service_dir
# build: ./my_test_service_dir
...
...
ufm-test-services/metamask/Dockerfile
View file @
e24d7720
FROM
node:18
FROM
mcr.microsoft.com/playwright:v1.37.1-jammy
WORKDIR
/app
WORKDIR
/app
COPY
./ ./
ENV
PATH /app/node_modules/.bin:$PATH
RUN
npm i
-g
pnpm
COPY
package.json /app/
RUN
pnpm
install
RUN
npm
install
COPY
tests /app/tests/
COPY
.env /app/
COPY
playwright.config.ts /app/
COPY
start.sh /app/
COPY
tsconfig.json /app/
CMD
/bin/sh /app/start.sh
CMD
/bin/sh /app/start.sh
ufm-test-services/metamask/package.json
View file @
e24d7720
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
},
},
"devDependencies"
:
{
"devDependencies"
:
{
"@metamask/test-dapp"
:
"^7.1.0"
,
"@metamask/test-dapp"
:
"^7.1.0"
,
"@playwright/test"
:
"
^
1.37.1"
,
"@playwright/test"
:
"1.37.1"
,
"@synthetixio/synpress"
:
"3.7.2-beta.5"
,
"@synthetixio/synpress"
:
"3.7.2-beta.5"
,
"dotenv"
:
"^16.3.1"
,
"dotenv"
:
"^16.3.1"
,
"static-server"
:
"^2.2.1"
,
"static-server"
:
"^2.2.1"
,
...
...
ufm-test-services/metamask/playwright.config.ts
View file @
e24d7720
...
@@ -40,7 +40,7 @@ export default defineConfig({
...
@@ -40,7 +40,7 @@ export default defineConfig({
/* Run your local dev server before starting the tests */
/* Run your local dev server before starting the tests */
webServer
:
{
webServer
:
{
command
:
'
p
npm run start:metamask-dapp
'
,
command
:
'
npm run start:metamask-dapp
'
,
url
:
process
.
env
.
METAMASK_DAPP_URL
,
url
:
process
.
env
.
METAMASK_DAPP_URL
,
reuseExistingServer
:
false
,
reuseExistingServer
:
false
,
},
},
...
...
ufm-test-services/metamask/start.sh
View file @
e24d7720
#!/bin/bash
#!/bin/bash
\ No newline at end of file
npm
test
\ No newline at end of file
ufm-test-services/metamask/tests/metamask.spec.ts
View file @
e24d7720
...
@@ -79,8 +79,8 @@ test('Send an EIP-1559 transaciton and verfiy success', async () => {
...
@@ -79,8 +79,8 @@ test('Send an EIP-1559 transaciton and verfiy success', async () => {
await
metamask
.
confirmTransaction
()
await
metamask
.
confirmTransaction
()
const
txHash
=
await
txHashPromise
const
txHash
=
await
txHashPromise
// Waiting for Infura (Metamask given provider) to index our transaction
// Waiting for Infura (Metamask given provider) to index our transaction
await
sharedPage
.
waitForTimeout
(
2
_000
)
await
sharedPage
.
waitForTimeout
(
10
_000
)
// Metamask test dApp allows us access to the Metamask RPC provider via loading this URL.
// Metamask test dApp allows us access to the Metamask RPC provider via loading this URL.
// The RPC reponse will be populated onto the page that's loaded.
// The RPC reponse will be populated onto the page that's loaded.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment