This is an automated email from the ASF dual-hosted git repository.
pabloem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push:
new e84a3e8e001 Playground Frontend Test workflow (#24728) (#25254)
e84a3e8e001 is described below
commit e84a3e8e0017f3a8648eaf365cd5a2526bea42df
Author: alexeyinkin <[email protected]>
AuthorDate: Wed Feb 8 21:00:51 2023 +0400
Playground Frontend Test workflow (#24728) (#25254)
* Playground Frontend Test workflow (#24728)
* Trigger the workflow (#24728)
* Test
* Test
* Test
* Test
* Test
* Test
* Test
* Test
* Test
* Test
* Test
* Test
* Test
* Fix
* Fix
* Clean up (#24728)
* Test
* Add Chrome requirement in README (#24728)
* Polish README (#24728)
* Fix a typo (#24728)
---
.github/workflows/playground_frontend_test.yml | 91 ++++++++++++++++++++++++++
playground/frontend/README.md | 11 ++--
playground/frontend/build.gradle | 5 +-
playground/frontend/lib/config.example.dart | 15 ++---
4 files changed, 107 insertions(+), 15 deletions(-)
diff --git a/.github/workflows/playground_frontend_test.yml
b/.github/workflows/playground_frontend_test.yml
new file mode 100644
index 00000000000..129234887b1
--- /dev/null
+++ b/.github/workflows/playground_frontend_test.yml
@@ -0,0 +1,91 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+name: Playground Frontend Test
+
+on:
+ push:
+ paths: ['playground/frontend/**']
+ branches: ['**']
+ pull_request:
+ paths: ['playground/frontend/**']
+ branches: ['**']
+ workflow_dispatch:
+
+# This allows a subsequently queued workflow run to interrupt previous runs
+concurrency:
+ group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label ||
github.head_ref || github.ref }}'
+ cancel-in-progress: true
+
+jobs:
+ playground_frontend_test:
+ name: Playground Frontend Test
+ runs-on: ubuntu-latest
+
+ env:
+ FLUTTER_VERSION: '3.3.2'
+
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: 'Cache Flutter Dependencies'
+ uses: actions/cache@v3
+ with:
+ path: /opt/hostedtoolcache/flutter
+ key: ${{ runner.OS }}-flutter-install-cache-${{ env.FLUTTER_VERSION
}}
+ restore-keys: ${{ runner.OS }}-flutter-install-cache
+
+ - uses: subosito/flutter-action@v2
+ with:
+ flutter-version: ${{ env.FLUTTER_VERSION }}
+ channel: 'stable'
+
+ - name: 'Install Dependencies'
+ working-directory: playground/frontend
+ run: |
+ cd playground_components && flutter pub get && cd ..
+ cd playground_components_dev && flutter pub get && cd ..
+ flutter pub get
+
+# - name: 'Formatting'
+# run: dart format --output=none --set-exit-if-changed .
+
+# - name: 'Analyze playground_components'
+# working-directory: playground/frontend/playground_components
+# run: dart analyze --fatal-infos
+
+# - name: 'Analyze playground_components_dev'
+# working-directory: playground/frontend/playground_components_dev
+# run: dart analyze --fatal-infos
+
+# - name: 'Analyze playground'
+# working-directory: playground/frontend
+# run: dart analyze --fatal-infos lib test
+
+ - name: 'Test playground_components'
+ working-directory: playground/frontend/playground_components
+ run: flutter test
+
+ - name: 'Test playground'
+ working-directory: playground/frontend
+ run: flutter test
+
+ - uses: nanasess/setup-chromedriver@v1
+
+ - name: 'Integration tests'
+ run: |
+ cp playground/frontend/lib/config.example.dart
playground/frontend/lib/config.g.dart
+ chromedriver --port=4444 &
+ ./gradlew :playground:frontend:integrationTest -PdeviceId=web-server
diff --git a/playground/frontend/README.md b/playground/frontend/README.md
index 120d9da7e2b..de8b99c8d3d 100644
--- a/playground/frontend/README.md
+++ b/playground/frontend/README.md
@@ -146,7 +146,7 @@ flutter format ./lib
To delete all generated files and re-generate them again and then run tests:
```bash
-./gradlew :playground:frontend:playground_components_test
+./gradlew :playground:frontend:playground_components::test
./gradlew :playground:frontend:test
```
@@ -164,9 +164,12 @@ flutter test
Integration tests currently can be run only on a local development machine.
Server testing has not been verified yet.
-1. Install and run Chrome Driver: https://chromedriver.chromium.org/downloads
-2. Run it on port 4444: `chromedriver --port=4444`
-3. Run:
+1. Install Google Chrome: https://www.google.com/chrome/
+2. Install Chrome Driver: https://chromedriver.chromium.org/downloads
+ - Note: This GitHub action installs both Chrome and Chrome Driver:
+
https://github.com/nanasess/setup-chromedriver/blob/a249caaaad10fd12103028fd509853c2229eb6e6/lib/setup-chromedriver.sh
+3. Run it on port 4444: `chromedriver --port=4444`
+4. Run:
```bash
./gradlew :playground:frontend:integrationTest
diff --git a/playground/frontend/build.gradle b/playground/frontend/build.gradle
index d20f6b02576..8bd1399d7e1 100644
--- a/playground/frontend/build.gradle
+++ b/playground/frontend/build.gradle
@@ -198,6 +198,9 @@
tasks.register("integrationTest_standalone_miscellaneous_ui") {
}
void runIntegrationTest(String path, String url) {
+ // Run with -PdeviceId=web-server for headless tests.
+ String deviceId = project.hasProperty("deviceId") ? project.deviceId :
"chrome"
+
exec {
executable("flutter")
args(
@@ -205,7 +208,7 @@ void runIntegrationTest(String path, String url) {
"--driver=test_driver/integration_test.dart",
"--target=integration_test/${path}_test.dart",
"--web-launch-url='$url'",
- "--device-id=chrome",
+ "--device-id=$deviceId",
)
}
}
diff --git a/playground/frontend/lib/config.example.dart
b/playground/frontend/lib/config.example.dart
index 0cfefe45a37..de50eac8249 100644
--- a/playground/frontend/lib/config.example.dart
+++ b/playground/frontend/lib/config.example.dart
@@ -22,13 +22,8 @@
// TODO: https://github.com/apache/beam/issues/24200
const String kAnalyticsUA = 'UA-73650088-2';
-const String kApiClientURL =
- 'https://backend-router-beta-dot-apache-beam-testing.appspot.com';
-const String kApiJavaClientURL =
- 'https://backend-java-beta-dot-apache-beam-testing.appspot.com';
-const String kApiGoClientURL =
- 'https://backend-go-beta-dot-apache-beam-testing.appspot.com';
-const String kApiPythonClientURL =
- 'https://backend-python-beta-dot-apache-beam-testing.appspot.com';
-const String kApiScioClientURL =
- 'https://backend-scio-beta-dot-apache-beam-testing.appspot.com';
+const String kApiClientURL = 'https://router.play-dev.beam.apache.org';
+const String kApiJavaClientURL = 'https://java.play-dev.beam.apache.org';
+const String kApiGoClientURL = 'https://go.play-dev.beam.apache.org';
+const String kApiPythonClientURL = 'https://python.play-dev.beam.apache.org';
+const String kApiScioClientURL = 'https://scio.play-dev.beam.apache.org';