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

feat: add docker testing #62

Merged
merged 47 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
1ad74c7
initial dockerfile
spion Jan 22, 2023
6e4a069
wip
spion Jan 22, 2023
39381d8
Initial successful test for Android 10 and fuse v1
spion Jan 23, 2023
75d3d9a
initial tests working
spion Jan 24, 2023
7c112ba
wip: add two tests
spion Jan 28, 2023
f13aa8f
try to make workflow work
spion Jan 28, 2023
ac967d5
add priviledged and remove sudo
spion Jan 28, 2023
85cc1ec
fix typo
spion Jan 28, 2023
9aae382
apt-get update first
spion Jan 28, 2023
337a8df
auto-yes apt-get install
spion Jan 28, 2023
3849a81
increase wait time
spion Jan 28, 2023
5bd7245
report last output when emulator not available
spion Jan 28, 2023
490f974
add dependency between buid and test
spion Jan 28, 2023
6c84ad0
show stderr for adb shell ls
spion Jan 28, 2023
4f09f5f
verbose errors
spion Jan 28, 2023
8b8e11d
do not run emulator in github actions
spion Jan 28, 2023
4aae834
not sure what is going on, investigating
spion Jan 28, 2023
9c20543
continued
spion Jan 28, 2023
f144e92
more diagnostics
spion Jan 28, 2023
6e72144
run with the right home directory
spion Jan 28, 2023
12b15fc
try macos latest for virtualization
spion Jan 29, 2023
5f709cd
fix: retention days and back to ubuntu runner
spion Aug 11, 2024
be8bcd9
chore: try ubuntu-latest
spion Aug 11, 2024
e30542c
fix: also run build on ubuntu-latest
spion Aug 11, 2024
ef51616
chore: try running without priviledged flag
spion Aug 11, 2024
f9ea09b
chore: try the newer docker-android tag scheme
spion Aug 11, 2024
085a0ae
fix: typo
spion Aug 11, 2024
e89d325
fix: use latest action versions
spion Aug 11, 2024
90aa9dd
fix: use sudo in docker-android image
spion Aug 11, 2024
8bdc243
fix: sudo the tests too
spion Aug 11, 2024
93f67e7
chore: try android-emulator-runner action instead
spion Aug 12, 2024
60da010
fix: kvm not kv
spion Aug 12, 2024
ffd15ec
fix: use actual script
spion Aug 12, 2024
92f5eb5
copy adbfs to right location and run as root
spion Aug 12, 2024
8a8503e
use sudo to copy the binary
spion Aug 12, 2024
128cab5
fix: wait_available /sdcard only
spion Aug 12, 2024
86be4cf
try root dir and list devices
spion Aug 12, 2024
50887a1
chore: add platform-tools to path
spion Aug 12, 2024
84e318a
fix: make it executable
spion Aug 12, 2024
04c458e
chore: cleanup
spion Aug 18, 2024
c9641c3
chore: work around poor multiline script behavior
spion Aug 18, 2024
4bcdec7
use env
spion Aug 18, 2024
c266959
feat: add AVD snapshot generation
spion Aug 18, 2024
21bcdf9
feat: add a decent coverage range
spion Aug 18, 2024
1fc5bc1
chore: do not fail fast
spion Aug 18, 2024
aa6f6a2
fix: reduce range of api-levels
spion Aug 18, 2024
ba3c576
fix: back to a single api-level
spion Aug 19, 2024
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
35 changes: 35 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# FROM ubuntu:22.04 as buildenv
spion marked this conversation as resolved.
Show resolved Hide resolved
# RUN apt install -y build-essential git pkg-config
# RUN apt install -y libfuse-dev fuse
# ADD ./* /src/
# WORKDIR /src
# RUN make


FROM budtmo/docker-android-x86-10.0
RUN apt update

RUN apt install -y build-essential git pkg-config

RUN apt install -y fuse libfuse-dev

ADD ./* /src/
ADD ./docker/* /src/docker/

WORKDIR /src
RUN make

RUN chmod +x /src/docker/run-docker-test.sh

WORKDIR /root
CMD /src/docker/run-docker-test.sh


# COPY --from=buildenv /src/adbfs /usr/bin/adbfs
# RUN chmod +x /usr/bin/adbfs






78 changes: 78 additions & 0 deletions docker/run-docker-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#!/bin/bash

echo Running supervisord in the background
# cd /root || exit
/usr/bin/supervisord --configuration supervisord.conf &

cd /src || exit



wait_available() {

RETRIES=60
WAIT_DIR="$1"

while [ $RETRIES -gt 0 ];
do
RETRIES=$((RETRIES - 1))

OUTPUT=$(adb shell ls -d "$WAIT_DIR" 2> /dev/null)

if [ "$OUTPUT" == "$WAIT_DIR" ]
then
break;
fi
sleep 1

done

if [ $RETRIES -le 0 ]
then
echo "Emulator directory $1 was not available, exiting"
exit 1
fi

}

echo Checking readiness via adb shell ls -d /sdcard/Android
wait_available /sdcard/Android

mkdir -p /adbfs
./adbfs /adbfs

echo Ready to run adbfs tests

BASE_DIR=/adbfs/sdcard/test

test_mkdir() {

mkdir "$BASE_DIR/x"
output=$(ls -lad "$BASE_DIR/x")
# TODO: verify output is correct

}



mkdir "$BASE_DIR"

test_mkdir




# todo, test mkdir

# create file with cat

# copy file


# touch to update time

# copy preserving timestamps

rm -rf "$BASE_DIR"