Skip to content
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

Fix "OpenShift: Create" command #2865

Merged
merged 1 commit into from
May 8, 2023

Conversation

datho7561
Copy link
Contributor

Closes #2864

Signed-off-by: David Thompson davthomp@redhat.com

@codecov
Copy link

codecov bot commented May 1, 2023

Codecov Report

Patch coverage: 48.78% and project coverage change: +0.79 🎉

Comparison is base (c1fef59) 33.77% compared to head (ef8eb26) 34.57%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2865      +/-   ##
==========================================
+ Coverage   33.77%   34.57%   +0.79%     
==========================================
  Files          55       55              
  Lines        4059     4075      +16     
  Branches      768      769       +1     
==========================================
+ Hits         1371     1409      +38     
+ Misses       2688     2666      -22     
Impacted Files Coverage Δ
src/odo.ts 32.21% <0.00%> (-0.97%) ⬇️
src/odo/command.ts 16.56% <83.33%> (+2.71%) ⬆️
src/oc.ts 100.00% <100.00%> (+80.00%) ⬆️
src/openshift/openshiftItem.ts 21.51% <100.00%> (+2.65%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@datho7561
Copy link
Contributor Author

I re-enabled the unit tests for this command; I still need to fix one of them though

@datho7561
Copy link
Contributor Author

@rgrunber This issue where all projects are detected as active should be fixed now. The solution was to use odo list project instead of oc get project

@datho7561
Copy link
Contributor Author

I think I should do a refactoring so that we always use this command when we want to list all projects on the cluster

@datho7561 datho7561 force-pushed the 2864-openshift-create branch 2 times, most recently from 2bbc152 to 7059f96 Compare May 8, 2023 14:34
Closes redhat-developer#2864

Signed-off-by: David Thompson <davthomp@redhat.com>
@datho7561
Copy link
Contributor Author

@rgrunber okay, I finished the refactoring. The UI tests have been flaky for me

@rgrunber
Copy link
Member

rgrunber commented May 8, 2023

Now when I call OpenShift: Create, it indicates the resource was successfully created. Checking the cli on the active project I see :

$ oc get templates
NAME                DESCRIPTION                                                                        PARAMETERS        OBJECTS
mongodb-ephemeral   MongoDB database service, without persistent storage. For more information ab...   8 (3 generated)   3

I think that fixes the issue. @datho7561 I'm not sure if we can do anything else here. According to the docs, once the template is added, it should be possible to call oc new-app mongodb-ephemeral-template (refering to the label of the template) but I don't see us using new-app anywhere.

@rgrunber rgrunber modified the milestone: 1.4.0 May 8, 2023
@rgrunber rgrunber merged commit 0b0160d into redhat-developer:main May 8, 2023
@datho7561 datho7561 deleted the 2864-openshift-create branch May 8, 2023 19:44
datho7561 added a commit to datho7561/vscode-openshift-tools that referenced this pull request May 19, 2023
- remove unused commands from `commands.ts` and unused methods from
  `odo.ts`
  - Notably, remove `ODO.getApplications()`, `ODO.getComponents()`,
    and the in-memory tree representing the cluster state,
    since they don't work properly and we have replacements for them
- rewrite integration tests for `commands.ts` and `odo.ts`
- report test coverage for integration tests
- add the integration tests to the UI test Jenkinsfile workflow

Depends on redhat-developer#2865, redhat-developer#2863, redhat-developer#2862

Fixes redhat-developer#2799

Signed-off-by: David Thompson <davthomp@redhat.com>
rgrunber pushed a commit that referenced this pull request May 19, 2023
- remove unused commands from `commands.ts` and unused methods from
  `odo.ts`
  - Notably, remove `ODO.getApplications()`, `ODO.getComponents()`,
    and the in-memory tree representing the cluster state,
    since they don't work properly and we have replacements for them
- rewrite integration tests for `commands.ts` and `odo.ts`
- report test coverage for integration tests
- add the integration tests to the UI test Jenkinsfile workflow

Depends on #2865, #2863, #2862

Fixes #2799

Signed-off-by: David Thompson <davthomp@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"OpenShift: Create" fails with "You need at least one project available"
2 participants