Skip to content

Commit

Permalink
fix unit tests (#2422)
Browse files Browse the repository at this point in the history
* fix unit tests

* update github runners to supported versions

Co-authored-by: Al Berez <aberezovsky@vmware.com>
  • Loading branch information
Benjamin Fuller and a-b committed May 17, 2023
1 parent 7ac2734 commit c89e4d1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/units.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ jobs:
matrix:
os:
- ubuntu-latest
- ubuntu-20.04
- macos-latest
- macos-10.15
- macos-11
runs-on: ${{ matrix.os }}
steps:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-repos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ jobs:
update-rpm:
name: Update RPM Repository
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
environment: ${{ needs.setup.outputs.secrets-environment }}
needs: setup
env:
Expand Down
19 changes: 19 additions & 0 deletions command/v7/logs_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,25 @@ var _ = Describe("logs command", func() {
When("there is an error refreshing a token sometime later", func() {
BeforeEach(func() {
cmd.Recent = false
fakeActor.GetStreamingLogsForApplicationByNameAndSpaceStub =
func(_ string, _ string, _ sharedaction.LogCacheClient) (
<-chan sharedaction.LogMessage,
<-chan error, context.CancelFunc,
v7action.Warnings,
error) {

logStream := make(chan sharedaction.LogMessage)
errorStream := make(chan error)

go func() {
time.Sleep(100 * time.Millisecond)
close(logStream)
close(errorStream)
return
}()

return logStream, errorStream, func() {}, v7action.Warnings{}, nil
}
fakeActor.ScheduleTokenRefreshStub = func(
after func(time.Duration) <-chan time.Time,
stop chan struct{}, stoppedRefreshing chan struct{}) (<-chan error, error) {
Expand Down

0 comments on commit c89e4d1

Please sign in to comment.