<commit_before>Feature: Plugin integrated in NDK app

# note: liblog is in the SO folder when built on Travis due to environment
# differences compared to building locally so these scenarios can fail when run locally

@requires_agp4_0_or_higher
Scenario: NDK apps send requests
    When I build the NDK app
    And I wait to receive 10 requests

    Then 1 requests are valid for the build API and match the following:
      | appVersionCode | appVersion | buildTool      |
      | 1              | 1.0        | gradle-android |

    And 8 requests are valid for the android NDK mapping API and match the following:
      | arch        | projectRoot | sharedObjectName |
      | arm64-v8a   | /\S+/       | liblog.so        |
      | arm64-v8a   | /\S+/       | libnative-lib.so |
      | armeabi-v7a | /\S+/       | liblog.so        |
      | armeabi-v7a | /\S+/       | libnative-lib.so |
      | x86         | /\S+/       | liblog.so        |
      | x86         | /\S+/       | libnative-lib.so |
      | x86_64      | /\S+/       | liblog.so        |
      | x86_64      | /\S+/       | libnative-lib.so |

    And 1 requests are valid for the android mapping API and match the following:
      | appId                      |
      | com.bugsnag.android.ndkapp |

    And 1 requests have an R8 mapping file with the following symbols:
      | jvmSymbols |
      | com.bugsnag.android.ndkapp.MainActivity |
      | java.lang.String doSomething() |

@requires_agp4_0_or_higher
Scenario: Custom projectRoot is added to payload
    When I set environment variable "PROJECT_ROOT" to "/repos/custom/my-app"
    And I build the NDK app
    And I wait to receive 10 requests

    Then 1 requests are valid for the build API and match the following:
      | appVersionCode | appVersion | buildTool      |
      | 1              | 1.0        | gradle-android |

    And 8 requests are valid for the android NDK mapping API and match the following:
      | arch        | projectRoot          |
      | arm64-v8a   | /repos/custom/my-app |
      | armeabi-v7a | /repos/custom/my-app |
      | x86         | /repos/custom/my-app |
      | x86_64      | /repos/custom/my-app |
      | arm64-v8a   | /repos/custom/my-app |
      | armeabi-v7a | /repos/custom/my-app |
      | x86         | /repos/custom/my-app |
      | x86_64      | /repos/custom/my-app |

    And 1 requests are valid for the android mapping API and match the following:
        | appId                      |
        | com.bugsnag.android.ndkapp |<commit_msg>test: update assertion to remove inlined method<commit_after>Feature: Plugin integrated in NDK app

# note: liblog is in the SO folder when built on Travis due to environment
# differences compared to building locally so these scenarios can fail when run locally

@requires_agp4_0_or_higher
Scenario: NDK apps send requests
    When I build the NDK app
    And I wait to receive 10 requests

    Then 1 requests are valid for the build API and match the following:
      | appVersionCode | appVersion | buildTool      |
      | 1              | 1.0        | gradle-android |

    And 8 requests are valid for the android NDK mapping API and match the following:
      | arch        | projectRoot | sharedObjectName |
      | arm64-v8a   | /\S+/       | liblog.so        |
      | arm64-v8a   | /\S+/       | libnative-lib.so |
      | armeabi-v7a | /\S+/       | liblog.so        |
      | armeabi-v7a | /\S+/       | libnative-lib.so |
      | x86         | /\S+/       | liblog.so        |
      | x86         | /\S+/       | libnative-lib.so |
      | x86_64      | /\S+/       | liblog.so        |
      | x86_64      | /\S+/       | libnative-lib.so |

    And 1 requests are valid for the android mapping API and match the following:
      | appId                      |
      | com.bugsnag.android.ndkapp |

    And 1 requests have an R8 mapping file with the following symbols:
      | jvmSymbols |
      | com.bugsnag.android.ndkapp.MainActivity |

@requires_agp4_0_or_higher
Scenario: Custom projectRoot is added to payload
    When I set environment variable "PROJECT_ROOT" to "/repos/custom/my-app"
    And I build the NDK app
    And I wait to receive 10 requests

    Then 1 requests are valid for the build API and match the following:
      | appVersionCode | appVersion | buildTool      |
      | 1              | 1.0        | gradle-android |

    And 8 requests are valid for the android NDK mapping API and match the following:
      | arch        | projectRoot          |
      | arm64-v8a   | /repos/custom/my-app |
      | armeabi-v7a | /repos/custom/my-app |
      | x86         | /repos/custom/my-app |
      | x86_64      | /repos/custom/my-app |
      | arm64-v8a   | /repos/custom/my-app |
      | armeabi-v7a | /repos/custom/my-app |
      | x86         | /repos/custom/my-app |
      | x86_64      | /repos/custom/my-app |

    And 1 requests are valid for the android mapping API and match the following:
        | appId                      |
        | com.bugsnag.android.ndkapp |
{'fraction_non_alphanumeric': 0.08682694218160143, 'fraction_numerical': 0.024637393204848004, 'mean_word_length': 1.746317512274959, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2623218', 'n_tokens_mistral': 1672, 'n_tokens_neox': 1512, 'n_words': 488}