Skip to content

run test in woolppecker ci#130

Open
ScharfViktor wants to merge 4 commits into
mainfrom
android-ci
Open

run test in woolppecker ci#130
ScharfViktor wants to merge 4 commits into
mainfrom
android-ci

Conversation

@ScharfViktor

@ScharfViktor ScharfViktor commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

related opencloud-eu/qa#82

  • running kaspresso tests in woodpecker CI

  • pipeline step is configured with the label: platform: android-emulator

  • woodpecker schedules the job on this dedicated server with kvm, where the Android emulator is available in docker and Kaspresso tests can be executed.

  • since we have only one device we use WOODPECKER_MAX_WORKFLOWS=1 which prevent parallel tests running

  • running existing espresso tests what need also server with kvm. note: Some tests was skipped in kaspresso integration tests #119 -> need fix

  • running android instrumented data tests

Result:

✅ passed:  199
❌ failed:  0
⏭  skipped: 27
   total:   226

@individual-it

individual-it commented May 6, 2026

Copy link
Copy Markdown
Contributor

Here is how it can work:

  1. on a dedicate server start the android emulator using docker
    1. use the code from https://github.com/HQarroum/docker-android
    2. set API_LEVEL=36 and IMG_TYPE=default in docker-compose.yml file
    3. change the ports to listen to all IPs: 5555:5555
    4. add - "cloud.opencloud.test:127.0.0.1 or whatever domain you are using to the extra_hosts
  2. create a root CA and a certificate for the opencloud server, here some example certificates that work for cloud.opencloud.test keycloak.opencloud.test: test-certificates.zip
  3. in the emulator manually import the root CA
  4. start the server with keycloak, traefic and opencloud
    1. make traefik use a custom port for HTTPS
    2. make traefik use the certificates from point 2
    3. e.g. when using https://github.com/opencloud-eu/opencloud-compose set:
      • TRAEFIK_SERVICES_TLS_CONFIG="tls=true"
      • TRAEFIK_PORT_HTTP=4080
      • TRAEFIK_PORT_HTTPS=4443
      • create a certs.yml with
        tls:
          certificates:
            - certFile: /certs/server.crt
              keyFile: /certs/server.key
              stores:
                - default
        
  5. start adbserver-desktop.jar
  6. connect to the dedicated server via adb connect <ip>:5555
  7. allow android to access port 4443 with adb reverse tcp:4443 tcp:4443
  8. run the tests
  9. copy android_avd folder of the dedicated server to a safe place. That folder contains all android data, including the certificate etc.

Next steps:

@individual-it

individual-it commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Test run now in woodpecker CI, without any ports being exposed to the public.
The android emulator can be reached with the docker instance running the tests and through a VPN. Using the VPN we can also see the tests running.

output.mp4

@individual-it

Copy link
Copy Markdown
Contributor

PRs from external forks need approval, tested in #187

@ScharfViktor ScharfViktor force-pushed the android-ci branch 2 times, most recently from eaec3c4 to 0a7d089 Compare June 8, 2026 08:41
@ScharfViktor

Copy link
Copy Markdown
Contributor Author

@guruz I see you updated Kaspresso to 1.6.1 here d28208a#diff-697f70cdd88ba88fe77eebda60c7e143f6ad1286bca75017421e93ad84fb87df

but it's incontibly with kotlin = "1.9.20"
I don’t know why kotlin = "1.9.20" hasn’t been updated, so I was a bit wary of doing it -> I’d rather leave it to you

@ScharfViktor ScharfViktor marked this pull request as ready for review June 8, 2026 09:18
Copilot AI review requested due to automatic review settings June 8, 2026 09:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Woodpecker CI plumbing to run Kaspresso-based Android integration tests against an emulator container, and updates the login UI-test selectors/flow to match the Keycloak login form used in CI.

Changes:

  • Add a Woodpecker pipeline step to connect to an emulator via ADB and run a targeted connected...AndroidTest.
  • Add docker-compose + env template for running an emulator (GPU) and Woodpecker agent on a dedicated network.
  • Update integration-test login screen selectors and test setup to use the Keycloak form and a remote RC environment URL.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
opencloudApp/src/integrationTest/java/screens/LoginScreen.kt Updates UIAutomator selectors for Keycloak login fields/buttons.
opencloudApp/src/integrationTest/java/eu/opencloud/android/LoginScreenTest.kt Adjusts login test flow, URL target, and adds extra permission grants.
opencloudApp/src/integrationTest/docker-compose.yaml Adds compose setup for emulator + Woodpecker agent networking and GPU configuration.
opencloudApp/src/integrationTest/.env.example Adds example env vars for Woodpecker agent configuration.
gradle/libs.versions.toml Adjusts the Kaspresso dependency version used by the project.
.woodpecker/integration-test.yml Adds Woodpecker pipeline to run the integration test on emulator-labeled agents.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread opencloudApp/src/integrationTest/docker-compose.yaml Outdated
Comment thread opencloudApp/src/integrationTest/.env.example Outdated
Comment thread .woodpecker/integration-test.yml Outdated
@ScharfViktor ScharfViktor force-pushed the android-ci branch 2 times, most recently from 6d1d9ea to 300ed83 Compare June 8, 2026 16:21
@ScharfViktor ScharfViktor requested review from kulmann and micbar June 9, 2026 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants