Skip to content

e2e: Unknown option: '--configuration' #10699

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

Closed
rokerkony opened this issue May 7, 2018 · 8 comments · Fixed by #10763
Closed

e2e: Unknown option: '--configuration' #10699

rokerkony opened this issue May 7, 2018 · 8 comments · Fixed by #10763

Comments

@rokerkony
Copy link

rokerkony commented May 7, 2018

Versions

Angular CLI: 6.0.0
Node: 10.0.0
OS: darwin x64
Angular: 6.0.0
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.0
@angular-devkit/build-angular     0.6.0
@angular-devkit/build-optimizer   0.6.0
@angular-devkit/core              0.6.0
@angular-devkit/schematics        0.6.0
@ngtools/webpack                  6.0.0
@schematics/angular               0.6.0
@schematics/update                0.6.0
rxjs                              6.1.0
typescript                        2.7.2
webpack                           4.6.0

Repro steps

  • Create new cli project
  • Add configuration section as follow to "<PROJECT_NAME>-e2e": {:
    "configurations": {
        "ci": {
            "serve": "false"
        }
    }
    
  • run ng e2e --configuration=ci

Observed behavior

Unknown option: '--configuration'

Desired behavior

e2e should support configuration

Mention any other details that might be useful

Unfortunatelly it is not only about --configuration but it doesn't respect also serve ng e2e --serve=false will still serve the app

@markgoho
Copy link
Contributor

markgoho commented May 7, 2018

It looks like the build file options object is missing serve and configuration

@filipesilva
Copy link
Contributor

Heya, the serve option is actually replaced with devServerTarget. If you set it to '' it will not be served. angular/devkit#876 should fix the serve option being erroneously accepted.

#10763 should fix --configuration not working with ng e2e.

hansl pushed a commit to angular/devkit that referenced this issue May 9, 2018
filipesilva added a commit to filipesilva/angular-cli that referenced this issue May 10, 2018
@filipesilva
Copy link
Contributor

I also updated https://github.com/angular/angular-cli/releases/tag/v6.0.0 to show this breaking change.

filipesilva added a commit to filipesilva/angular-cli that referenced this issue May 10, 2018
filipesilva added a commit to filipesilva/angular-cli that referenced this issue May 10, 2018
filipesilva added a commit to filipesilva/angular-cli that referenced this issue May 10, 2018
filipesilva added a commit to filipesilva/angular-cli that referenced this issue May 10, 2018
filipesilva added a commit to filipesilva/angular-cli that referenced this issue May 10, 2018
@dethstrobe
Copy link

Is there a way to have the configurations for the e2e swap the environment variables?

I tried adding something like

                        "test": {
                            "fileReplacements": [{
                                "src": "src/environments/environment.ts",
                                "replaceWith": "src/environments/environment.test.ts"
                            }, {
                                "src": "src/environments/config.scss",
                                "replaceWith": "src/environments/config.test.scss"
                            }]
                        }

but it outputs

Schema validation failed with the following errors:
  Data path "" should NOT have additional properties(fileReplacements).

So instead I try and replace the devServerTarget with my test config from my server like

                        "test": {
                            "devServerTarget": "mxc:serve:test"
                        }

But it doesn't like that either and outputs:

Unknown option: '--configuration'

Anyway, I'd like to be able to run my e2e tests against other environments before deploying to them. Is the only way to get around this is to create an e2e project for each environment?

@rokerkony
Copy link
Author

@dethstrobe --configuration is already working on v6.0.1 (and @angular-devkit/build-angular@0.6.1)

@dethstrobe
Copy link

Thanks @rokerkony that is it. I just needed that small version bump. Thanks

@JounQin
Copy link
Contributor

JounQin commented Jun 5, 2018

@filipesilva https://github.com/angular/angular-cli/wiki/e2e should be updated about these changes.

hansl pushed a commit that referenced this issue Jun 6, 2018
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants