Skip to content

merge tq package to master#1780

Merged
technoweenie merged 50 commits intomasterfrom
tq-master
Dec 16, 2016
Merged

merge tq package to master#1780
technoweenie merged 50 commits intomasterfrom
tq-master

Conversation

@technoweenie
Copy link
Contributor

ttaylorr and others added 30 commits December 12, 2016 09:24
tq: prioritize transferring retries before new items
technoweenie and others added 20 commits December 14, 2016 10:06
tq: simplify usage of `tq.Transfer`
teach the smudge filter how to use the transfer queue directly
Change Adapter Begin() signature to accept an AdapterConfig interface
tq: un-export `NewTransfer` and `Batch`
lfs,cmd: remove lfs.New{Downloadable,Uploadable}
@ttaylorr
Copy link
Contributor

Tracking: #1764.

@technoweenie technoweenie merged commit 9fd3467 into master Dec 16, 2016
@ttaylorr ttaylorr deleted the tq-master branch December 29, 2016 03:49
chrisd8088 added a commit to chrisd8088/git-lfs that referenced this pull request Jul 27, 2023
The three test functions in the tq/transfer_test.go source file are
all named with the prefix "test" rather than "Test", and as a result,
do not actually execute.  This oversight dates from the original
introduction of these tests in the "transfer" package in commit
10623f5 of PR git-lfs#1265.  (The package
was later renamed to the current "tq" package in commit
891db97 of PR git-lfs#1780.)

We therefore change the test function names to begin with "Test",
and resolve several test regressions which have accumulated since the
tests were first added.

First, the TestBasicAdapterExists() function calls the
GetDownloadAdapterNames() and GetUploadAdapterNames() methods of the
Manifest structure, and these now return the names of three transfer
adapter implementations rather than just the original "basic" one,
so we allow for all three names to appear in any order.  (The
"lfs-standalone-file" adapter was added in commit
bb05cf5 of PR git-lfs#3748, and the "ssh"
adapter was added in commit 594f8e3
of PR git-lfs#4446.)

Second, the TestAdapterRegAndOverride() function expects the
NewDownloadAdapter() and NewUploadAdapter() methods of the Manifest
structure to return nil if the provided name argument does not match
that of any registered transfer adapter.  However, this has not been
the behaviour of those methods since commit
c5c2a75 of PR git-lfs#1279, shortly after
the tests were first introduced in PR git-lfs#1265.  In that commit, the
NewAdapterOrDefault() method was added, and the NewDownloadAdapter()
and NewUploadAdapter() revised to call it, so they return the
default "basic" adapter if the requested name does not match a
registered adapter.  We therefore revise and expand the test to
account for this behaviour, and also make sure to directly test the
simpler NewAdapter() method, which retains the originally intended
behaviour and returns nil if it does not find a matching adapter
for the provided name argument.
chrisd8088 added a commit to chrisd8088/git-lfs that referenced this pull request Jul 27, 2023
The three test functions in the tq/transfer_test.go source file are
all named with the prefix "test" rather than "Test", and as a result,
do not actually execute.  This oversight dates from the original
introduction of these tests in the "transfer" package in commit
10623f5 of PR git-lfs#1265.  (The package
was later renamed to the current "tq" package in commit
891db97 of PR git-lfs#1780.)

We therefore change the test function names to begin with "Test",
and resolve several test regressions which have accumulated since the
tests were first added.

First, the TestBasicAdapterExists() function calls the
GetDownloadAdapterNames() and GetUploadAdapterNames() methods of the
Manifest structure, and these now return the names of three transfer
adapter implementations rather than just the original "basic" one,
so we allow for all three names to appear in any order.  (The
"lfs-standalone-file" adapter was added in commit
bb05cf5 of PR git-lfs#3748, and the "ssh"
adapter was added in commit 594f8e3
of PR git-lfs#4446.)

Second, the TestAdapterRegAndOverride() function expects the
NewDownloadAdapter() and NewUploadAdapter() methods of the Manifest
structure to return nil if the provided name argument does not match
that of any registered transfer adapter.  However, this has not been
the behaviour of those methods since commit
c5c2a75 of PR git-lfs#1279, shortly after
the tests were first introduced in PR git-lfs#1265.  In that commit, the
NewAdapterOrDefault() method was added, and the NewDownloadAdapter()
and NewUploadAdapter() revised to call it, so they return the
default "basic" adapter if the requested name does not match a
registered adapter.  We therefore revise and expand the test to
account for this behaviour, and also make sure to directly test the
simpler NewAdapter() method, which retains the originally intended
behaviour and returns nil if it does not find a matching adapter
for the provided name argument.

Third, the TestAdapterRegButBasicOnly() function, which passes without
changes, no longer fully performs the checks it was intended to make,
since the NewDownloadAdapter() and NewUploadAdapter() methods now always
return a non-nil value, so using a non-nil response from them to prove
that the "test" adapter is found is insufficient.  We therefore update
the test to confirm that the returned value from these functions is
a "test" adapter, as expected, and not just a "basic" one.

We also replace the use of the BasicAdapterName variable with the
"basic" string to align with the other tests.
chrisd8088 added a commit to chrisd8088/git-lfs that referenced this pull request Jul 27, 2023
The three test functions in the tq/transfer_test.go source file are
all named with the prefix "test" rather than "Test", and as a result,
do not actually execute.  This oversight dates from the original
introduction of these tests in the "transfer" package in commit
10623f5 of PR git-lfs#1265.  (The package
was later renamed to the current "tq" package in commit
891db97 of PR git-lfs#1780.)

We therefore change the test function names to begin with "Test",
and resolve several test regressions which have accumulated since the
tests were first added.

First, the TestBasicAdapterExists() function calls the
GetDownloadAdapterNames() and GetUploadAdapterNames() methods of the
Manifest structure, and these now return the names of three transfer
adapter implementations rather than just the original "basic" one,
so we allow for all three names to appear in any order.  (The
"lfs-standalone-file" adapter was added in commit
bb05cf5 of PR git-lfs#3748, and the "ssh"
adapter was added in commit 594f8e3
of PR git-lfs#4446.)

Second, the TestAdapterRegAndOverride() function expects the
NewDownloadAdapter() and NewUploadAdapter() methods of the Manifest
structure to return nil if the provided name argument does not match
that of any registered transfer adapter.  However, this has not been
the behaviour of those methods since commit
c5c2a75 of PR git-lfs#1279, shortly after
the tests were first introduced in PR git-lfs#1265.  In that commit, the
NewAdapterOrDefault() method was added, and the NewDownloadAdapter()
and NewUploadAdapter() methods revised to call it, so they return the
default "basic" adapter if the requested name does not match a
registered adapter.  We therefore revise and expand the test to
account for this behaviour, and also make sure to directly test the
underlying NewAdapter() method, which retains the originally intended
behaviour and returns nil if it does not find a matching adapter
for the provided name argument.

Third, although the TestAdapterRegButBasicOnly() function passes without
changes, it no longer fully performs the checks it was intended to make,
since the NewDownloadAdapter() and NewUploadAdapter() methods now always
return a non-nil value, so using a non-nil response from them to prove
that the "test" adapter was found is insufficient.  We therefore update
the test to confirm that the returned value from these functions is
a "test" adapter, as expected, and not just a "basic" one.

We also replace the use of the BasicAdapterName variable with the
"basic" string to align with the other tests.
bartvdbraak pushed a commit to bartvdbraak/git-lfs that referenced this pull request Jan 20, 2026
The three test functions in the tq/transfer_test.go source file are
all named with the prefix "test" rather than "Test", and as a result,
do not actually execute.  This oversight dates from the original
introduction of these tests in the "transfer" package in commit
10623f5 of PR git-lfs#1265.  (The package
was later renamed to the current "tq" package in commit
891db97 of PR git-lfs#1780.)

We therefore change the test function names to begin with "Test",
and resolve several test regressions which have accumulated since the
tests were first added.

First, the TestBasicAdapterExists() function calls the
GetDownloadAdapterNames() and GetUploadAdapterNames() methods of the
Manifest structure, and these now return the names of three transfer
adapter implementations rather than just the original "basic" one,
so we allow for all three names to appear in any order.  (The
"lfs-standalone-file" adapter was added in commit
bb05cf5 of PR git-lfs#3748, and the "ssh"
adapter was added in commit 594f8e3
of PR git-lfs#4446.)

Second, the TestAdapterRegAndOverride() function expects the
NewDownloadAdapter() and NewUploadAdapter() methods of the Manifest
structure to return nil if the provided name argument does not match
that of any registered transfer adapter.  However, this has not been
the behaviour of those methods since commit
c5c2a75 of PR git-lfs#1279, shortly after
the tests were first introduced in PR git-lfs#1265.  In that commit, the
NewAdapterOrDefault() method was added, and the NewDownloadAdapter()
and NewUploadAdapter() methods revised to call it, so they return the
default "basic" adapter if the requested name does not match a
registered adapter.  We therefore revise and expand the test to
account for this behaviour, and also make sure to directly test the
underlying NewAdapter() method, which retains the originally intended
behaviour and returns nil if it does not find a matching adapter
for the provided name argument.

Third, although the TestAdapterRegButBasicOnly() function passes without
changes, it no longer fully performs the checks it was intended to make,
since the NewDownloadAdapter() and NewUploadAdapter() methods now always
return a non-nil value, so using a non-nil response from them to prove
that the "test" adapter was found is insufficient.  We therefore update
the test to confirm that the returned value from these functions is
a "test" adapter, as expected, and not just a "basic" one.

We also replace the use of the BasicAdapterName variable with the
"basic" string to align with the other tests.
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.

2 participants