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

Unit Test(s) Migration #287

Merged
merged 20 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
8d2b9f3
chore: [test] add BRConstantsTest for unitTest and deprecated Constan…
andhikayuana Nov 30, 2024
95e345c
chore: [test] remove unused test files
andhikayuana Dec 2, 2024
3c1a464
chore: [test] add todo to fill the tests and change package name
andhikayuana Dec 2, 2024
d16fcdb
chore: [test] add basic example
andhikayuana Dec 2, 2024
7542fe1
chore: [test] integrate with ci/cd
andhikayuana Dec 4, 2024
29f3f6a
chore: [test][ci] fix Cannot find a definition for command named andr…
andhikayuana Dec 4, 2024
96c1f6b
chore: [test][ci] fix Cannot find a definition for command named andr…
andhikayuana Dec 4, 2024
5fd3017
chore: [test][ci] fix Unexpected argument(s): test-command
andhikayuana Dec 4, 2024
39d19c3
chore: [test][ci] fix Cannot find a definition for executor named and…
andhikayuana Dec 4, 2024
3dbb7c4
chore: [test][ci] add default for gradle.properties
andhikayuana Dec 4, 2024
5e8f40a
chore: [test][ci] avoid breaking in build.gradle
andhikayuana Dec 4, 2024
0ac17e6
chore: [test][ci] enable androidx and jetifier
andhikayuana Dec 4, 2024
b105350
chore: [test][ci] init submodule
andhikayuana Dec 4, 2024
3d4e99c
chore: [test][ci] just using run command for execute unit test step
andhikayuana Dec 4, 2024
69ea1e1
chore: [test][ci] add env for google-services.json
andhikayuana Dec 4, 2024
9d2463c
chore: [test][ci] add env for google-services.json
andhikayuana Dec 4, 2024
45aa5f6
chore: [test][ci] add env for google-services.json
andhikayuana Dec 4, 2024
182b44f
Major refactor of code to move classes to the ideal location
kcw-grunt Dec 5, 2024
3479a24
chore: resolve CurrencyTests
andhikayuana Dec 10, 2024
6afdc5e
Added notes
kcw-grunt Dec 12, 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
46 changes: 36 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,51 @@
# See: https://circleci.com/docs/2.0/configuration-reference
version: 2.1

orbs:
android: circleci/android@3.0.2

# Define a job to be invoked later in a workflow.
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
jobs:
say-hello:
# Specify the execution environment. You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub.
# See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor
docker:
- image: cimg/base:stable
# Add steps to the job
# See: https://circleci.com/docs/2.0/configuration-reference/#steps
unit-test:
executor:
name: android/android_machine
resource_class: large
tag: default
steps:
- checkout
- run:
name: "Say hello"
command: "echo Hello, World!"
command: "echo Hello, World! && ls"
- run:
name: "Default for gradle.properties"
command: "echo \"RELEASE_STORE_FILE=/\nRELEASE_STORE_PASSWORD=\nRELEASE_KEY_ALIAS=\nRELEASE_KEY_PASSWORD=\nandroid.useAndroidX=true\nandroid.enableJetifier=true\" >> gradle.properties && ls && cat gradle.properties"
- run:
name: "Initialize submodule"
command: "git submodule init && git submodule update --init --recursive"
- run:
name: "Copy google-services.json"
command: echo "$GOOGLE_SERVICES_JSON" | base64 --decode > app/google-services.json
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the error from circleci mallformed here, need recheck the base64 encoded from google-services.json

Copy link
Contributor

Choose a reason for hiding this comment

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

@andhikayuana yes we need to add a debug version to circleci TODO

- android/restore_gradle_cache
- run:
name: "Execute Unit Test"
command: ./gradlew testLitewalletDebugUnitTest
- android/save_gradle_cache
- run:
name: Save test results
command: |
mkdir -p ~/test-results/junit/
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/junit/ \;
when: always
- store_test_results:
path: ~/test-results
- store_artifacts:
path: ~/test-results/junit


# Invoke jobs via workflows
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
workflows:
say-hello-workflow:
test-and-build:
jobs:
- say-hello
- unit-test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,4 @@ app/src/litewalletDebug/google-services.json
/.idea/dictionaries/grunt.xml
androidTestResultsUserPreferences.xml
.idea/deploymentTargetSelector.xml
.idea/inspectionProfiles/Project_Default.xml
3 changes: 3 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ dependencies {
implementation 'org.json:json:20231013'
implementation 'androidx.navigation:navigation-fragment-ktx:2.7.7'
implementation 'androidx.navigation:navigation-ui-ktx:2.7.7'
implementation 'androidx.test.ext:junit-ktx:1.2.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'junit:junit:4.12'
androidTestImplementation('androidx.test.espresso:espresso-core:3.5.1')
Expand Down
81 changes: 0 additions & 81 deletions app/src/androidTest/java/com/litewallet/PaperKeyTests.java

This file was deleted.

This file was deleted.

Loading