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

chore(tests): Allow test-watch-for-repl target to run while the app is running #20827

Merged

Conversation

ilmotta
Copy link
Contributor

@ilmotta ilmotta commented Jul 19, 2024

Summary

This PR fixes a long standing problem, at least in my machines: I can't run in parallel the make target run-clojure and test-watch-for-repl, or in other words, I can't do run tests via the REPL while the app is running :rage2:

Details

I found out that shadow-cljs fails to build because it does not expand the environment variables SHADOW_OUTPUT_TO and SHADOW_NS_REGEXP if and only if the run-clojure target was executed. Clearly looks like a bug.

This is the top of the stacktrace, and it happens because it doesn't know where to output the test build because the env var wasn't expanded:

[build] NullPointerException:
[build]         shadow.build.node/configure (node.clj:59)
[build]         shadow.build.node/configure (node.clj:45)
[build]         shadow.build.targets.node-script/configure (node_script.clj:37)

The solution is to pass the option --config-merge to shadow-cljs and override both :ns-regexp and :output-to because CLI args override options from env vars in shadow-cljs.

Areas that may be impacted

None.

Steps to test

Please, check you can do make run-clojure in one session/terminal and make test-watch-for-repl in another session/terminal, and that you are able to connect with the REPL successfully.

If you are using Emacs and you are already connected to the normal app REPL (:mobile target), after running test-watch-for-repl you can connect to the test REPL by using cider-connect-sibling-cljs. There are probably other ways. Then, if you have selected the correct CLJS buffer, if you run the tests with something like (cljs.test/run-tests) it will work, as usual. I don't know the instructions to connect to two REPLs in VS Code, but I'm pretty sure this is supported.

status: ready

@status-im-auto
Copy link
Member

status-im-auto commented Jul 19, 2024

Jenkins Builds

Click to see older builds (4)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ d96fa11 #1 2024-07-19 19:21:04 ~4 min tests 📄log
✔️ d96fa11 #1 2024-07-19 19:24:02 ~7 min android-e2e 🤖apk 📲
✔️ d96fa11 #1 2024-07-19 19:24:08 ~7 min android 🤖apk 📲
✔️ d96fa11 #1 2024-07-19 19:25:58 ~9 min ios 📱ipa 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ e605765 #2 2024-07-22 02:50:04 ~4 min tests 📄log
✔️ e605765 #2 2024-07-22 02:51:50 ~6 min android 🤖apk 📲
✔️ e605765 #2 2024-07-22 02:52:29 ~7 min android-e2e 🤖apk 📲
✔️ e605765 #2 2024-07-22 02:54:14 ~8 min ios 📱ipa 📲
✔️ 8928ade #3 2024-07-24 03:09:23 ~4 min tests 📄log
✔️ 8928ade #3 2024-07-24 03:11:28 ~6 min android-e2e 🤖apk 📲
✔️ 8928ade #3 2024-07-24 03:11:41 ~6 min android 🤖apk 📲
✔️ 8928ade #3 2024-07-24 03:13:54 ~8 min ios 📱ipa 📲

Copy link
Contributor

@shivekkhurana shivekkhurana left a comment

Choose a reason for hiding this comment

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

Thank you for this feature.

This was making me brain hurt for sometime. Whenever I wanted to test, I lost my REPL connection.

@ilmotta ilmotta force-pushed the ilmotta/allow-watch-repl-target-to-run-alongside-mobile-build branch from d96fa11 to e605765 Compare July 22, 2024 02:44
@status-im-auto
Copy link
Member

71% of end-end tests have passed

Total executed tests: 7
Failed tests: 1
Expected to fail tests: 1
Passed tests: 5
IDs of failed tests: 727229 
IDs of expected to fail tests: 727232 

Failed tests (1)

Click to expand
  • Rerun failed tests

  • Class TestWalletMultipleDevice:

    1. test_wallet_send_eth, id: 727229

    Device 2: Find `Text` by `xpath`: `//android.view.ViewGroup[@content-desc='container']/android.widget.TextView[@text='Ether']/../android.widget.TextView[3]`
    Device 2: `Text` is `0.01129 ETH`

    critical/test_wallet.py:156: in test_wallet_send_eth
        self.errors.verify_no_errors()
    base_test_case.py:191: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Sender balance is not updated on Etherscan, it is 0.4876 but expected to be 0.4877
    



    Expected to fail tests (1)

    Click to expand

    Class TestWalletOneDevice:

    1. test_wallet_add_remove_watch_only_account, id: 727232

    Device 1: Find EditBox by accessibility id: add-address-to-watch
    Device 1: Type 0x8d2413447ff297d30bdc475f6d5cb00254685aae to EditBox

    critical/test_wallet.py:249: in test_wallet_add_remove_watch_only_account
        self.wallet_view.add_watch_only_account(address=address_to_watch, account_name=new_account_name)
    ../views/wallet_view.py:163: in add_watch_only_account
        self.account_has_activity_label.wait_for_visibility_of_element()
    ../views/base_element.py:147: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 1: Text by accessibility id:`account-has-activity` is not found on the screen after wait_for_visibility_of_element 
    

    [[Missing networks in account address, https://github.com//issues/20166]]

    Device sessions

    Passed tests (5)

    Click to expand

    Class TestWalletMultipleDevice:

    1. test_wallet_send_asset_from_drawer, id: 727230

    Class TestWalletOneDevice:

    1. test_wallet_add_remove_regular_account, id: 727231
    Device sessions

    Class TestCommunityOneDeviceMerged:

    1. test_restore_multiaccount_with_waku_backup_remove_switch, id: 703133
    Device sessions

    2. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    @ilmotta ilmotta force-pushed the ilmotta/allow-watch-repl-target-to-run-alongside-mobile-build branch from e605765 to 8928ade Compare July 24, 2024 03:04
    @ilmotta ilmotta merged commit cef1308 into develop Jul 24, 2024
    6 checks passed
    @ilmotta ilmotta deleted the ilmotta/allow-watch-repl-target-to-run-alongside-mobile-build branch July 24, 2024 03:18
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    Status: DONE
    Development

    Successfully merging this pull request may close these issues.

    None yet

    4 participants