Detox Testing - How to disable detox info logging to stdout - react-native

I've read through the docs and cannot find a way to set the log level to something like "silent". I don't want to see all the detox log info. I just want to see the test output. The current log levels are:
-l, --loglevel [value] info, debug, verbose, silly, wss
Not specifying a log level defaults to info.
example:

Remove --loglevel from you detox test --loglevel.

Now there are more options - fatal, error, warn, info, verbose, trace (see docs)
detox test --loglevel fatal
Results in clean test execution output:

Related

NP publishing library gives a git error and will not publish

I'm trying to add a library for better publishing experience (np).
The issue is, I'm getting this error regardless of what option/version I use:
✖ Command failed with exit code 128: git log --format=%s %h 715331db5d0ebbcda8751b08eaa4f84b213b2ff1
fb769f732b295e9debdfe80fe6a2c4d050a4093e..HEAD
fatal: ambiguous argument '715331db5d0ebbcda8751b08eaa4f84b213b2ff1
fb769f732b295e9debdfe80fe6a2c4d050a4093e..HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
I'm not well versed enough with git to understand what this is trying to tell me, plus searches for the error led me to dead ends.

GnuPG: gpa.exe hungs when click on "smartcards" AND scdaemon cannot recognise SC-HSM 4K

https://dev.gnupg.org/T6097
I am tring it get GnuPG to work with my SmartCard-HSM 4K on Windows, using the GP4Win bundle.
Kleopatra doesn't recognise the SC-HSM 4K at all, even though, it DOES recognise the YubiKey 5 NFC in BOTH PIV and Openpgp Card apps.
When trying to use the GPA.exe alternative, it just freezes when I click on the "smartcards" button; not sure if it's related.
Trying to debug this, using CMD:
scdaemon --server
serialno
I get the following result:
scdaemon[xxxxx]: detected reader 'ACS ACR38U 0' scdaemon[xxxxx]:
reader slot 0: not connected scdaemon[xxxxx]: pcsc_control failed:
invalid PC/SC error code (0x1) scdaemon[xxxxx]:
pcsc_vendor_specific_init: GET_FEATURE_REQUEST failed: 65547
scdaemon[xxxxx]: reader slot 0: active protocol: T1 scdaemon[xxxxx]:
slot 0: ATR=3bde18ff8191fe1fxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
scdaemon[xxxxx]: error parsing PrKDF record: Invalid object
scdaemon[xxxxx]: no supported card application found: Invalid object S
PINCACHE_PUT 0// ERR 100696144 No such device
Below I am including my configuration files.
scdaemon.conf
###+++--- GPGConf ---+++###
verbose
verbose
verbose
verbose
verbose
verbose
verbose
verbose
verbose
disable-ccid
###+++--- GPGConf ---+++### 09/06/y22 23:29:33 GTB Daylight Time
# GPGConf edited this configuration file.
# It will disable options before this marked block, but it will
# never change anything below these lines.
#pcsc-shared
I have tried all possible combinations with disable-ccid and pcsc-shared and nothing works.
gpgagent.conf
###+++--- GPGConf ---+++###
enable-extended-key-format
ignore-cache-for-signing
no-allow-external-cache
no-allow-loopback-pinentry
grab
pinentry-timeout 10
verbose
verbose
verbose
verbose
verbose
verbose
verbose
verbose
verbose
ssh-fingerprint-digest SHA384
###+++--- GPGConf ---+++### 18/04/y22 07:30:51 GTB Daylight Time
# GPGConf edited this configuration file.
# It will disable options before this marked block, but it will
# never change anything below these lines.
enable-putty-support
enable-ssh-support
use-standard-socket
default-cache-ttl 600
max-cache-ttl 7200
gpgsm.conf
###+++--- GPGConf ---+++###
auto-issuer-key-retrieve
enable-crl-checks
enable-ocsp
verbose
verbose
verbose
verbose
verbose
verbose
verbose
verbose
verbose
include-certs -1
cipher-algo AES256
###+++--- GPGConf ---+++### 01/04/y22 19:10:26 GTB Daylight Time
# GPGConf edited this configuration file.
# It will disable options before this marked block, but it will
# never change anything below these lines.
I was never able to get the SC-HSM to work with GnuPG, even though it is supposedly supported. This is the current time I am trying to figure it out. This time, I haven't played with anything else than scdaemon.conf, but, as far as I can tell, the SC-HSM didn't work even with the defaults on a fresh install.
The card otherwise works nicely with everything else. Any help would be greatly appreciated!
I believe I have found the cause of the problem with the GnuPG. When removing the AES key from the card, the error about the invalid PrKDF disappeared. The card can still NOT be used those as the keys don't show up with gpg --card-edit --expert or in Kleopatra. Maybe the SC-HSM versions supported are only the older ones and for the newer cards there needs to be some update for the card profile?

Android emulator tear down during tests run

guys!
I run my Android tests with Appium on Android emulator. Where I run my tests in sequence emulator sometimes tear down and remaining tests are ignored.
In Appium logs i see this error:
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: 'Command 'C:\\Users\\Username\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe -P 5037 -s emulator-5554 shell settings delete global hidden_api_policy_pre_p_apps' exited with code 20'; Stderr: 'cmd: Can't find service: settings'; Code: '20'
Is there anybody face with such problem?
You are trying to run an adb-shell command which is not allowed.
Appium has some in-secure commands that normally it will not allow them to be used.
You can see the commands here: Appium Insecure Features
The adb-shell commands (to change the system settings) is one of them.
Follow the link to how to prevent appium checking this.
How to resolve:
At the beginning of test setup, run this commnad: appium --relaxed-security with command line. Then the appium let you using the insecure feautures during the test.
for example in pyhton you should run os.system(appium --relaxed-security (while having appium directory in the system environment variables path.

Generating the release APK

while Generating the release APK it gives error:
Task :app:bundleReleaseJsAndAssets
Scanning folders for symlinks in C:\root\React_Native\rncourse\node_modules (83ms)
Scanning folders for symlinks in C:\root\React_Native\rncourse\node_modules (108ms)
Loading dependency graph, done.
warning: the transform cache was reset.
bundle: Writing bundle output to: C:\root\React_Native\rncourse\android\app\build\intermediates\assets\release\index.android.bundle
bundle: Done writing bundle output
bundle: Copying 4 asset files
bundle: Done copying assets
C:\root\React_Native\rncourse\android\app\build\intermediates\res\merged\release\drawable-mdpi\src_assets_logopng.png: error: uncompiled PNG file passed as argument. Must be compiled first into .flat file..
error: failed parsing overlays.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processReleaseResources'.
Failed to process resources, see aapt output above for details.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
For a workaround solution you can add this line to your android/gradle.properties file:
android.enableAapt2=false
but as I said, it's a workaround and is deprecated.
I didn't find a complete solution for this but if I do find a better solution, I'll edit my answer!
Two things you can do to avoid this error
1. You can try with delete build folder and make a new release build
2. try deleting android\app\build\intermediates\res\merged\release\drawable-mdpi in your project
may be these points avoids your problem

How can i get the result of a test (fail/pass) written in to a variable/file when testing with Detox on TravisCI

Im building my React Native app with TravisCI and using Detox to run E2E on the version.
The Detox test results are printed to the travis console but i need to know fail or pass in an env var so i could act on it.
The test command is:
detox test --configuration ios.sim.debug
So i've tried:
export SANITY_RES=$(detox test --configuration ios.sim.debug)
but echo $SANITY_RES only contains:
configuration="ios.sim.debug" artifactsLocation="artifacts/ios.sim.debug.2018-12-25 14-42-58Z" node_modules/.bin/jest e2e --config=e2e/config.json --maxWorkers=1 '--testNamePattern=^((?!:android:).)$' detox[80481] INFO: [DetoxServer.js] server listening on localhost:51067...*
and not the final result.
Any other way i could get them ?
Detox allows you the ability to write logs of your builds. See for more details https://github.com/wix/Detox/blob/master/docs/APIRef.Artifacts.md
If you add —record-logs all as a flag to your detox test it will save all the logs of the build, change it to —record-logs failing if you only want logs of failing tests.
You can even specify where the logs will be stored.