SAP / ui5-tooling

An open and modular toolchain to develop state of the art applications based on the UI5 framework
https://sap.github.io/ui5-tooling
Apache License 2.0
466 stars 69 forks source link

Dependency test-resources should be omitted in build #379

Open BenReim opened 5 years ago

BenReim commented 5 years ago

Expected Behavior

test-resources of project dependencies shall not be part of a (production) build

Current Behavior

test-resources folder is part of the build result

Steps to reproduce the issue

  1. Clone ui5lab sample library git clone https://github.com/UI5Lab/UI5Lab-library-simple

  2. Build library ui5 build --a

  3. Check the content of the dist folder - contains test-resources of dependencies

    UI5Lab-app-simple (master)
    $ ls -1 ./dist
    Component.js
    Component-dbg.js
    Component-preload.js
    controller/
    css/
    i18n/
    index.html
    indexSelfContained.html
    manifest.json
    model/
    resources/
    test/
    test-resources/ <---- test resources of ui5lab-library dependency
    view/
RandomByte commented 5 years ago

I think this is more of an enhancement, but definitely something we should look into.

Currently, test-resources might be required when one libraries tests depend on test specific helper modules located in another libraries test-resources. This means we'll probably need a switch of some sort. Possibly something like:

Command Result
ui5 build --all Everything (current behavior)
ui5 build --runtime Like --all but excluding test-resources
henriquemattos commented 2 months ago

Hi, @RandomByte . Any news on this topic? Or is it safe to exclude tests with any CLI param?

Cheers, Henrique

RandomByte commented 2 months ago

This issue is rather old and didn't get updated. By now you can configure excludes for resources like /test-resources/** in the ui5.yaml: https://sap.github.io/ui5-tooling/stable/pages/Configuration/#exclude-resources

@matz3 should we close this? I think the main requirement got implemented. Although we could discuss the default behavior more.

CLVNSwan commented 1 month ago

In current version the "test-resources" folder is still part of the dist folder, including all dependencies

UI5 CLI Version:

3.11.0

UI5 YAML Version:

3.2

console script:

ui5 build --clean-dest --all 

ui5.yaml

specVersion: "3.2"
metadata:
    name: **hide**
type: application
framework:
    name: OpenUI5
    version: 1.120.10
    libraries:
        - name: sap.f
        - name: sap.m
        - name: sap.ui.core
        - name: sap.ui.layout
        - name: themelib_sap_horizon
        - name: sap.tnt
resources:
    configuration:
        paths:
            webapp: /out
builder:
    resources:
        excludes:
            - "/localService/**"
            - "/test/**"
            - "/test-resources/**"

current output:

- dist 
  - resources
  - test-resources
  - ...additionalFiles

expected output:

- dist 
  - resources
  - ...additionalFiles
RandomByte commented 1 month ago

@CLVNSwan thanks. That's true. If the dependency is not your own project, you can't define excludes on the respective test-resources.

henriquemattos commented 6 hours ago

hi, @RandomByte . Is there a specific reason why we include the test-resources (i.e. from OpenUI5/SAPUI5 resources)? This makes my build longer, and my push to AWS S3 (CDN) 10x longer.

I'm not sure if I read somewhere that this could happen because some productive components rely on test resources (or vice-versa)?! Or do you know a different reasoning for including the test-resources from productive components?

Kind regards, Henrique

RandomByte commented 4 hours ago

hi, @RandomByte . Is there a specific reason why we include the test-resources (i.e. from OpenUI5/SAPUI5 resources)?

This was caused by a misconfiguration in the release process affecting the sap.ui.core library. We have fixed the issue and all new releases should not contain this vast amount of test-resources anymore.

Affected versions are all current releases between UI5 1.115 and 1.127.

1.128.0 is already fixed, all coming patch releases should be fixed as well.

henriquemattos commented 4 hours ago

That's awesome! Thank you so much!!! Gotta 💙 UI5 Team!