Skip to content

Commit

Permalink
Merge pull request #49 from sky172839465/test
Browse files Browse the repository at this point in the history
test: update app content and test scenario
  • Loading branch information
sky172839465 authored Jan 17, 2024
2 parents 12de53e + f1e8ca6 commit 42ce075
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 21 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ on:
workflow_dispatch:
inputs:
app:
description: 'app name'
default: 'pr-41-sky172839465-integration-example'
description: "app name"
default: "pr-41-sky172839465-integration-example"
required: true
type: string
isDestroy:
description: 'isDestoryApp'
description: "isDestoryApp"
required: true
type: boolean

Expand Down
4 changes: 4 additions & 0 deletions __e2e__/pages/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ Scenario('test localhost content', async ({ I }) => {
I.amOnMySite()
I.wait(1)
I.see('Learn React', 'a.App-link')
I.click('#btn')
const resultSelector = '#result'
I.waitForVisible(resultSelector)
I.see('Hello world', resultSelector)
})
48 changes: 30 additions & 18 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -1,40 +1,52 @@
app = "test-integration-example"
# fly.toml app configuration file generated for test-integration-example on 2024-01-18T00:37:46+08:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

# https://github.com/fly-apps/hello-create-react-app/blob/main/fly.toml
app = "test-integration-example"
primary_region = "nrt"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []

[env]
kill_timeout = "5s"

[experimental]
allowed_public_ports = []
auto_rollback = true

[build]

[http_service]
internal_port = 3000
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
processes = ["app"]

[[services]]
http_checks = []
protocol = "tcp"
internal_port = 80
processes = ["app"]
protocol = "tcp"
script_checks = []
[services.concurrency]
hard_limit = 25
soft_limit = 20
type = "connections"

[[services.ports]]
handlers = ["http"]
port = 80
handlers = ["http"]

[[services.ports]]
handlers = ["tls", "http"]
port = 443
handlers = ["tls", "http"]
[services.concurrency]
type = "connections"
hard_limit = 25
soft_limit = 20

[[services.tcp_checks]]
grace_period = "1s"
interval = "15s"
restart_limit = 0
timeout = "2s"
grace_period = "1s"

[[vm]]
cpu_kind = "shared"
cpus = 1
memory_mb = 1024

[[statics]]
guest_path = "/usr/share/nginx/html/"
Expand Down
9 changes: 9 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { useState } from 'react'
import logo from './logo.svg'
import './App.css'

function App() {
const [visible, setVisible] = useState(false)

return (
<div className='App'>
<header className='App-header'>
Expand All @@ -21,6 +24,12 @@ function App() {
{process.env.REACT_APP_VERSION}
</p>
</a>
<div>
<button id='btn' onClick={() => setVisible(!visible)}>setVisible</button>
{visible && (
<p id='result'>Hello world</p>
)}
</div>
</header>
</div>
)
Expand Down

0 comments on commit 42ce075

Please sign in to comment.