<commit_before>Feature: Plugin integrated in NDK app

@skip_agp4_0_or_higher
Scenario: NDK apps send requests
    When I build the NDK app
    Then I should receive 6 requests

    And the request 0 is valid for the Build API
    And the payload field "appVersion" equals "1.0" for request 0
    And the payload field "apiKey" equals "your-api-key-here" for request 0
    And the payload field "builderName" is not null for request 0
    And the payload field "buildTool" equals "gradle-android" for request 0
    And the payload field "appVersionCode" equals "1" for request 0

    And the request 1 is valid for the Android NDK Mapping API
    And the payload field "apiKey" equals "your-api-key-here" for request 1
    And the payload field "projectRoot" is not null for request 1
    And the payload field "arch" equals "arm64-v8a" for request 1

    And the request 2 is valid for the Android NDK Mapping API
    And the payload field "apiKey" equals "your-api-key-here" for request 2
    And the payload field "projectRoot" is not null for request 2
    And the payload field "arch" equals "armeabi-v7a" for request 2

    And the request 3 is valid for the Android NDK Mapping API
    And the payload field "apiKey" equals "your-api-key-here" for request 3
    And the payload field "projectRoot" is not null for request 3
    And the payload field "arch" equals "x86" for request 3

    And the request 4 is valid for the Android NDK Mapping API
    And the payload field "apiKey" equals "your-api-key-here" for request 4
    And the payload field "projectRoot" is not null for request 4
    And the payload field "arch" equals "x86_64" for request 4

    And the request 5 is valid for the Android Mapping API
    And the payload field "apiKey" equals "your-api-key-here" for request 5

@skip_agp4_0_or_higher
Scenario: Custom projectRoot is added to payload
    When I set environment variable "PROJECT_ROOT" to "/repos/custom/my-app"
    When I build the NDK app
    Then I should receive 6 requests

    And the request 5 is valid for the Android Mapping API

    And the request 1 is valid for the Android NDK Mapping API
    And the payload field "projectRoot" equals "/repos/custom/my-app" for request 1

    And the request 2 is valid for the Android NDK Mapping API
    And the payload field "projectRoot" equals "/repos/custom/my-app" for request 2

    And the request 3 is valid for the Android NDK Mapping API
    And the payload field "projectRoot" equals "/repos/custom/my-app" for request 3

    And the request 4 is valid for the Android NDK Mapping API
    And the payload field "projectRoot" equals "/repos/custom/my-app" for request 4

    And the request 0 is valid for the Build API

# Sets a non-existent objdump location for x86 and arm64-v8a, delivery should proceed as normal for other files
@skip_agp4_0_or_higher
Scenario: Custom objdump location
    When I set environment variable "OBJDUMP_LOCATION" to "/fake/objdump"
    When I build the NDK app
    Then I should receive 4 requests

    And the request 3 is valid for the Android Mapping API

    And the request 1 is valid for the Android NDK Mapping API
    And the payload field "arch" equals "armeabi-v7a" for request 1

    And the request 2 is valid for the Android NDK Mapping API
    And the payload field "arch" equals "x86_64" for request 2

    And the request 0 is valid for the Build API

@skip_agp4_0_or_higher
Scenario: NDK app only uploads SO file matching architecture for ABI splits
    When I set environment variable "ABI_SPLITS" to "enabled"
    When I build the NDK app
    Then I should receive 14 requests

    And the request 13 is valid for the Android Mapping API
    And the payload field "versionCode" equals "5" for request 13

    And the request 12 is valid for the Android Mapping API
    And the payload field "versionCode" equals "4" for request 12

    And the request 11 is valid for the Android Mapping API
    And the payload field "versionCode" equals "1" for request 11

    And the request 7 is valid for the Android NDK Mapping API
    And the payload field "arch" equals "arm64-v8a" for request 7

    And the request 8 is valid for the Android NDK Mapping API
    And the payload field "arch" equals "armeabi-v7a" for request 8

    And the request 9 is valid for the Android NDK Mapping API
    And the payload field "arch" equals "x86" for request 9<commit_msg>test: skip flaky tests on AGP 3.6<commit_after>Feature: Plugin integrated in NDK app

@skip_agp4_0_or_higher
Scenario: NDK apps send requests
    When I build the NDK app
    Then I should receive 6 requests

    And the request 0 is valid for the Build API
    And the payload field "appVersion" equals "1.0" for request 0
    And the payload field "apiKey" equals "your-api-key-here" for request 0
    And the payload field "builderName" is not null for request 0
    And the payload field "buildTool" equals "gradle-android" for request 0
    And the payload field "appVersionCode" equals "1" for request 0

    And the request 1 is valid for the Android NDK Mapping API
    And the payload field "apiKey" equals "your-api-key-here" for request 1
    And the payload field "projectRoot" is not null for request 1
    And the payload field "arch" equals "arm64-v8a" for request 1

    And the request 2 is valid for the Android NDK Mapping API
    And the payload field "apiKey" equals "your-api-key-here" for request 2
    And the payload field "projectRoot" is not null for request 2
    And the payload field "arch" equals "armeabi-v7a" for request 2

    And the request 3 is valid for the Android NDK Mapping API
    And the payload field "apiKey" equals "your-api-key-here" for request 3
    And the payload field "projectRoot" is not null for request 3
    And the payload field "arch" equals "x86" for request 3

    And the request 4 is valid for the Android NDK Mapping API
    And the payload field "apiKey" equals "your-api-key-here" for request 4
    And the payload field "projectRoot" is not null for request 4
    And the payload field "arch" equals "x86_64" for request 4

    And the request 5 is valid for the Android Mapping API
    And the payload field "apiKey" equals "your-api-key-here" for request 5

@skip_agp4_0_or_higher
Scenario: Custom projectRoot is added to payload
    When I set environment variable "PROJECT_ROOT" to "/repos/custom/my-app"
    When I build the NDK app
    Then I should receive 6 requests

    And the request 5 is valid for the Android Mapping API

    And the request 1 is valid for the Android NDK Mapping API
    And the payload field "projectRoot" equals "/repos/custom/my-app" for request 1

    And the request 2 is valid for the Android NDK Mapping API
    And the payload field "projectRoot" equals "/repos/custom/my-app" for request 2

    And the request 3 is valid for the Android NDK Mapping API
    And the payload field "projectRoot" equals "/repos/custom/my-app" for request 3

    And the request 4 is valid for the Android NDK Mapping API
    And the payload field "projectRoot" equals "/repos/custom/my-app" for request 4

    And the request 0 is valid for the Build API

# Sets a non-existent objdump location for x86 and arm64-v8a, delivery should proceed as normal for other files
@skip_agp3_6 # skip AGP 3.6 until request ordering does not matter in tests
@skip_agp4_0_or_higher
Scenario: Custom objdump location
    When I set environment variable "OBJDUMP_LOCATION" to "/fake/objdump"
    When I build the NDK app
    Then I should receive 4 requests

    And the request 3 is valid for the Android Mapping API

    And the request 1 is valid for the Android NDK Mapping API
    And the payload field "arch" equals "armeabi-v7a" for request 1

    And the request 2 is valid for the Android NDK Mapping API
    And the payload field "arch" equals "x86_64" for request 2

    And the request 0 is valid for the Build API

@skip_agp3_6 # skip AGP 3.6 until request ordering does not matter in tests
@skip_agp4_0_or_higher
Scenario: NDK app only uploads SO file matching architecture for ABI splits
    When I set environment variable "ABI_SPLITS" to "enabled"
    When I build the NDK app
    Then I should receive 14 requests

    And the request 13 is valid for the Android Mapping API
    And the payload field "versionCode" equals "5" for request 13

    And the request 12 is valid for the Android Mapping API
    And the payload field "versionCode" equals "4" for request 12

    And the request 11 is valid for the Android Mapping API
    And the payload field "versionCode" equals "1" for request 11

    And the request 7 is valid for the Android NDK Mapping API
    And the payload field "arch" equals "arm64-v8a" for request 7

    And the request 8 is valid for the Android NDK Mapping API
    And the payload field "arch" equals "armeabi-v7a" for request 8

    And the request 9 is valid for the Android NDK Mapping API
    And the payload field "arch" equals "x86" for request 9
{'fraction_non_alphanumeric': 0.042140468227424746, 'fraction_numerical': 0.024080267558528427, 'mean_word_length': 3.359086491739553, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2245644', 'n_tokens_mistral': 2737, 'n_tokens_neox': 2465, 'n_words': 1397}