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

Add more test case for target's spec.TargetDir #820

Merged
merged 3 commits into from
Sep 28, 2020

Conversation

9547
Copy link
Contributor

@9547 9547 commented Sep 26, 2020

What problem does this PR solve?

Fix problems introduced by #755, tiup update --self results to ~/.tiup/bin/tiup deleted.

and based on #816

(base) root@rabbit:tiup <master(v1.1.0-41-gdfab8de)>$ tiup update --self
download https://tiup-mirrors.pingcap.com/tiup-v1.1.2-linux-amd64.tar.gz 4.32 MiB / 4.32 MiB 100.00% 15.68 MiB p/s
Updated successfully!
(base) root@rabbit:tiup <master(v1.1.0-41-gdfab8de)>$ tiup update --self
-bash: /home/.tiup/bin/tiup: No such file or directory

What is changed and how it works?

in #755 L233-L237 were removed, revert thos lines back, and here we check the targetDir before InstallComponent inside UpdateComponents

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Code changes

  • Has exported function/method change
  • Has exported variable/fields change
  • Has interface methods change
  • Has persistent data change

Side effects

  • Possible performance regression
  • Increased code complexity
  • Breaking backward compatibility

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation

Release notes:

Fix `tiup update --self` results to tiup's binary file deleted

@codecov-commenter
Copy link

codecov-commenter commented Sep 26, 2020

Codecov Report

Merging #820 into master will decrease coverage by 3.52%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #820      +/-   ##
==========================================
- Coverage   51.26%   47.73%   -3.53%     
==========================================
  Files         258      259       +1     
  Lines       18804    18833      +29     
==========================================
- Hits         9639     8990     -649     
- Misses       7649     8378     +729     
+ Partials     1516     1465      -51     
Flag Coverage Δ
#cluster 44.72% <0.00%> (+1.24%) ⬆️
#dm 25.10% <0.00%> (-0.01%) ⬇️
#integrate 47.73% <0.00%> (+0.64%) ⬆️
#playground 22.17% <0.00%> (-0.01%) ⬇️
#tiup 10.83% <0.00%> (?)
#unittest ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/repository/v1_repository.go 50.76% <ø> (-13.78%) ⬇️
pkg/repository/v1manifest/local_manifests.go 34.33% <0.00%> (-4.46%) ⬇️
pkg/utils/semver.go 0.00% <0.00%> (-100.00%) ⬇️
components/dm/ansible/worker.go 0.00% <0.00%> (-100.00%) ⬇️
pkg/telemetry/scrub.go 6.66% <0.00%> (-80.00%) ⬇️
pkg/telemetry/telemetry.go 0.00% <0.00%> (-66.67%) ⬇️
components/dm/ansible/import.go 0.00% <0.00%> (-61.99%) ⬇️
pkg/cluster/ansible/import.go 0.00% <0.00%> (-57.41%) ⬇️
pkg/cluster/executor/local.go 0.00% <0.00%> (-56.34%) ⬇️
pkg/repository/v1manifest/keys.go 3.27% <0.00%> (-55.74%) ⬇️
... and 63 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 879ae13...dd186de. Read the comment docs.

@9547 9547 force-pushed the fix/tiup-update-self-missing-binary branch from 570d2a0 to 3f8c03b Compare September 26, 2020 14:45
@9547 9547 changed the title repository: set target to spec.TargetDir if given, else local profile Add more test case for target's spec.TargetDir Sep 27, 2020
@9547 9547 force-pushed the fix/tiup-update-self-missing-binary branch from 3f8c03b to 03fb5f2 Compare September 27, 2020 14:15
@lonng lonng added this to the v1.2.0 milestone Sep 28, 2020
@lonng lonng added the type/enhancement Categorizes issue or PR as related to an enhancement. label Sep 28, 2020
Copy link
Contributor

@lonng lonng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 28, 2020
@lonng
Copy link
Contributor

lonng commented Sep 28, 2020

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 28, 2020
@ti-srebot
Copy link
Contributor

Your auto merge job has been accepted, waiting for:

  • 811

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@9547 merge failed.

@lonng lonng merged commit da151c5 into pingcap:master Sep 28, 2020
@9547 9547 deleted the fix/tiup-update-self-missing-binary branch September 28, 2020 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1. type/enhancement Categorizes issue or PR as related to an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants