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

Remove of purchasing backend & fix tests #2849

Merged
merged 12 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ jobs:
- name: run tests
env:
TEST_MERGIN_URL: https://test.dev.merginmaps.com/
TEST_API_USERNAME: test_mobileapp
TEST_API_PASSWORD: ${{ secrets.TEST_API_PASSWORD }}
PeterPetrik marked this conversation as resolved.
Show resolved Hide resolved
QT_QPA_PLATFORM: "offscreen"
run: |
cd build-Input-db/
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ jobs:
- name: run tests
env:
TEST_MERGIN_URL: https://test.dev.merginmaps.com/
TEST_API_USERNAME: test_mobileapp2
TEST_API_PASSWORD: ${{ secrets.TEST_API_PASSWORD }}
run: |
cd build-Input-db/
ctest --output-on-failure
Expand Down
25 changes: 1 addition & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,6 @@ else ()
set(HAVE_BLUETOOTH_DEFAULT TRUE)
endif ()

if (IOS)
set(HAVE_PURCHASING_DEFAULT TRUE)
set(HAVE_APPLE_PURCHASING_DEFAULT TRUE)
else ()
set(HAVE_PURCHASING_DEFAULT ${ENABLE_TESTS_DEFAULT})
set(HAVE_APPLE_PURCHASING_DEFAULT FALSE)
endif ()

# on android in multi-ABI build, command line variables are NOT passed to
# ExternalProject_Add called by QT. Therefore we need to pass the variables through ENV
if (ANDROID)
Expand Down Expand Up @@ -150,14 +142,7 @@ set(HAVE_BLUETOOTH
${HAVE_BLUETOOTH_DEFAULT}
CACHE BOOL "Building with bluetooth position provider"
)
set(HAVE_PURCHASING
${HAVE_PURCHASING_DEFAULT}
CACHE BOOL "Build with purchasing (e.g. for test of purchasing GUI)"
)
set(HAVE_APPLE_PURCHASING
${HAVE_APPLE_PURCHASING_DEFAULT}
CACHE BOOL "Building with Apple's StoreKit support"
)

set(QT6_VERSION
${QT_VERSION_DEFAULT}
CACHE STRING "QT6 version to use"
Expand Down Expand Up @@ -343,14 +328,6 @@ if (ENABLE_TESTS)
set(TEST_DATA_DIR "${CMAKE_CURRENT_BINARY_DIR}/test/test_data")
endif ()

if (HAVE_PURCHASING)
set(PURCHASING TRUE)
endif ()

if (HAVE_APPLE_PURCHASING)
set(APPLE_PURCHASING TRUE)
endif ()

configure_file(
${CMAKE_SOURCE_DIR}/cmake_templates/inputconfig.h.in ${CMAKE_BINARY_DIR}/inputconfig.h
)
Expand Down
21 changes: 19 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Building Mergin Maps Input from source - step by step
Building Mergin Maps mobile app from source - step by step


# Table of Contents
Expand All @@ -16,7 +16,7 @@ Building Mergin Maps Input from source - step by step
* [5. Building iOS](#5-building-ios)
* [6. Building macOS](#6-building-macos)
* [7. Building Windows](#7-building-windows)

* [8. Auto Testing](#9-auto-testing)

# 1. Introduction

Expand Down Expand Up @@ -372,3 +372,20 @@ set CL=/MP
nmake
```

# 8. Auto Testing

You need to add cmake define `-DENABLE_TESTING=TRUE` on your cmake configure line.
Also you need to open Passbolt and check for password for user `test_mobileapp_dev` on `test.dev.merginmaps.com`,
or you need some user with unlimited projects limit. First workspace from list is taken.

! Note that the same user cannot run tests in paraller !

now you need to set environment variables:
```
TEST_MERGIN_URL=test.dev.merginmaps.com
TEST_API_USERNAME=test_mobileapp_dev
TEST_API_PASSWORD=<your_password>
```

Build binary and you can run tests either with `ctest` or you can run individual tests by adding `--test<TestName>`
e.g. ` ./input --testMerginApi`
24 changes: 6 additions & 18 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ set(MM_SRCS
projectsmodel.cpp
projectsproxymodel.cpp
projectwizard.cpp
purchasing.cpp
qrdecoder.cpp
relationfeaturesmodel.cpp
relationreferencefeaturesmodel.cpp
Expand Down Expand Up @@ -149,7 +148,6 @@ set(MM_HDRS
projectsmodel.h
projectsproxymodel.h
projectwizard.h
purchasing.h
qrdecoder.h
relationfeaturesmodel.h
relationreferencefeaturesmodel.h
Expand Down Expand Up @@ -181,14 +179,12 @@ if (ENABLE_TESTS)
test/testformeditors.cpp
test/testidentifykit.cpp
test/testimageutils.cpp
test/testingpurchasingbackend.cpp
test/testlayertree.cpp
test/testlinks.cpp
test/testmaptools.cpp
test/testmerginapi.cpp
test/testmodels.cpp
test/testposition.cpp
test/testpurchasing.cpp
test/testrememberattributescontroller.cpp
test/testscalebarkit.cpp
test/testutils.cpp
Expand All @@ -207,14 +203,12 @@ if (ENABLE_TESTS)
test/testformeditors.h
test/testidentifykit.h
test/testimageutils.h
test/testingpurchasingbackend.h
test/testlayertree.h
test/testlinks.h
test/testmaptools.h
test/testmerginapi.h
test/testmodels.h
test/testposition.h
test/testpurchasing.h
test/testrememberattributescontroller.h
test/testscalebarkit.h
test/testutils.h
Expand All @@ -223,6 +217,12 @@ if (ENABLE_TESTS)
test/testactiveproject.h
test/testprojectchecksumcache.h
)

if (NOT USE_MM_SERVER_API_KEY)
set_property(
SOURCE test/testmerginapi.cpp PROPERTY COMPILE_DEFINITIONS USE_MERGIN_DUMMY_API_KEY
)
endif ()
endif ()

if (IOS)
Expand All @@ -246,12 +246,6 @@ if (IOS)
)
endif ()

if (HAVE_APPLE_PURCHASING)
set(MM_HDRS ${MM_HDRS} ios/iospurchasing.h)

set(MM_SRCS ${MM_SRCS} ios/iospurchasing.mm)
endif ()

if (ANDROID)
set(MM_HDRS ${MM_HDRS} position/tracking/androidtrackingbackend.h
position/tracking/androidtrackingbroadcast.h
Expand Down Expand Up @@ -538,12 +532,6 @@ if (IOS)
target_link_libraries(Input PUBLIC AppleFrameworks::CoreLocation)
endif ()

if (HAVE_APPLE_PURCHASING)
target_link_libraries(
Input PUBLIC AppleFrameworks::StoreKit AppleFrameworks::Foundation
)
endif ()

if (ENABLE_TESTS)
target_link_libraries(Input PUBLIC Qt6::Test)
endif ()
Expand Down
120 changes: 0 additions & 120 deletions app/ios/iospurchasing.h

This file was deleted.

Loading