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 previous-image flag #1198

Merged
merged 7 commits into from
Aug 11, 2021
Merged

Add previous-image flag #1198

merged 7 commits into from
Aug 11, 2021

Conversation

importhuman
Copy link
Member

@importhuman importhuman commented Jun 9, 2021

Signed-off-by: Ujjwal Goyal importujjwal@gmail.com

Summary

Add previous-image flag for #897 with an Images field. I have started with the changes required to the analyze phase, but am having trouble writing the test for it (passing when it should fail).

Additional assistance required:

  • cannot run make format, make tidy or make prepare-for-pr, getting the error "./create_builder.go" contains more than 3 groups of imports.
  • observing some untracked files with the name format "internal/registry/registry177994269/" while making changes, what to do with them?
  • unclear about when to run make prepare-for-pr. Does "before creating a Pull Request" mean before adding and committing?

Output

Before

After

Documentation

Related

Concerns #897 (Doesn't resolve yet)

@importhuman importhuman requested a review from a team as a code owner June 9, 2021 15:00
@github-actions github-actions bot added the type/enhancement Issue that requests a new feature or improvement. label Jun 9, 2021
@github-actions github-actions bot added this to the 0.19.0 milestone Jun 9, 2021
@aemengo
Copy link
Contributor

aemengo commented Jun 10, 2021

Thanks so much for helping out!

getting the error "./create_builder.go" contains more than 3 groups of imports.

Wild. I never see that error, but the linter is correct. The imports should be: stdlib, external dependencies, internal dependencies. You didn't introduce the error as part of this PR so I don't think it's worth your time, in this PR. See: #1187 (comment)

observing some untracked files with the name format "internal/registry/registry177994269/" while making changes, what to do with them?

Please just ignore them. We definitely need to cleanup, our cleanup logic, there. 😅

unclear about when to run make prepare-for-pr. Does "before creating a Pull Request" mean before adding and committing?

After adding and committing, but before git push.

build.go Outdated Show resolved Hide resolved
@dfreilich dfreilich modified the milestones: 0.19.0, 0.20.0 Jun 15, 2021
internal/build/lifecycle_execution_test.go Outdated Show resolved Hide resolved
internal/build/lifecycle_execution.go Outdated Show resolved Hide resolved
build.go Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jun 17, 2021

Codecov Report

Merging #1198 (e3b5c16) into main (b956476) will increase coverage by 0.06%.
The diff coverage is 100.00%.

❗ Current head e3b5c16 differs from pull request most recent head b6a2e29. Consider uploading reports for the commit b6a2e29 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1198      +/-   ##
==========================================
+ Coverage   80.94%   80.99%   +0.06%     
==========================================
  Files         136      136              
  Lines        8313     8315       +2     
==========================================
+ Hits         6728     6734       +6     
+ Misses       1159     1156       -3     
+ Partials      426      425       -1     
Flag Coverage Δ
os_linux 80.51% <100.00%> (+0.01%) ⬆️
os_macos 78.10% <100.00%> (+0.05%) ⬆️
os_windows 80.91% <100.00%> (+0.06%) ⬆️
unit 80.59% <100.00%> (+0.04%) ⬆️

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

@dfreilich dfreilich changed the title Add flag for #897 Add previous-image flag Jun 24, 2021
Copy link
Member

@dfreilich dfreilich left a comment

Choose a reason for hiding this comment

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

In terms of code, @importhuman , this looks superb. Fits with our coding styles, and is very clean and pristine. Good work!

In terms of UX, I'm a bit concerned that people may not understand exactly what this option is (I would have difficulty explaining when to use this or not to use it). @ekcasey or @natalieparellano , can we have some further explanation of how/why people would want to use this, which we can add to the flag description and make it a bit clearer?

@importhuman
Copy link
Member Author

@dfreilich Thanks! Trying to figure out the edge case now. Also, not working on the analyzer scenario in this PR, as suggested by @natalieparellano on slack.

I don't really understand how to use myself either, I've been going along what was given in the description and further discussions. 😅

@github-actions github-actions bot added the type/chore Issue that requests non-user facing changes. label Jul 6, 2021
Copy link
Member Author

@importhuman importhuman left a comment

Choose a reason for hiding this comment

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

Having some trouble with writing certain tests 😅

@@ -1764,6 +1764,45 @@ func testAcceptance(
})
})

Copy link
Member Author

Choose a reason for hiding this comment

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

Couldn't figure out how to write the acceptance test. This is based off the cache-image test, but failing.

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's not bother with an acceptance test for this.

They're slower, require more resources, and are more likely to fail. We should reserve them for more critical code paths with more moving parts. Although this PR touches a few moving parts, we have plenty other acceptance tests that the reduce need for this one.

Copy link
Member Author

Choose a reason for hiding this comment

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

@aemengo I did observe that it took a bit of time. I added the acceptance test because it was suggested to do so in the issue. If @jromero says it's alright without this test then I agree that we can skip it.


lastCallIndex := len(fakePhaseFactory.NewCalledWithProvider) - 1
h.AssertNotEq(t, lastCallIndex, -1)
// when("image is invalid", func() {
Copy link
Member Author

Choose a reason for hiding this comment

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

Tried to add a unit test to check for invalid images, but couldn't figure out how to pass an invalid image name in the test as it gets validated. Tried passing tags like "%%%", tags with other invalid characters, tags with multiple slashes, etc.

Copy link
Contributor

Choose a reason for hiding this comment

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

Once again, I'd rather not bother with a test for this 😅

A test to check that we're bubbling up the error would be of low value, imo. Such a test would be more valuable if it were our logic deciding what a valid/invalid image tag is.

In this case, I'd be comfortable having faith in our third-party library having its own tests. And then saving ourselves the keystrokes for every error check.

Copy link
Member Author

Choose a reason for hiding this comment

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

Cool, will remove.

h.AssertNil(t, command.Execute())
})
})

Copy link
Member Author

Choose a reason for hiding this comment

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

Couldn't figure out this test case, get the following error message:
=== RUN TestBuildCommand/Commands/#BuildCommand/previous-image_flag_is_provided/--publish_is_true/image_and_previous-image_are_not_in_same_registry/fails build.go:130: Unexpected call to *testmocks.MockPackClient.Build([context.Background { index.docker.io/some/image:latest my-builder map[] map[] true false false [] [] <nil> { []} always . {{ []} {[] [] [] [] } map[]} -1 example.io/some/previous-image}]) at /Users/ujjwal/coding/pack/internal/commands/build.go:130 because: there are no expected calls of the method "Build" for that receiver

Copy link
Contributor

Choose a reason for hiding this comment

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

Mock assertions are always painful to read. In this case, it's complaining that your mock received a call, but your test setup did not have the relevant mockClient.EXPECT() line.

Stepping back for a second. This unit test doesn't feel appropriate here. The logic for actually creating the error is way down in internal/build/lifecycle_execution.go. It feels like there's a decision to make about moving the test down or bringing the logic up...

I'd much prefer that you bring this logic (and tests) up. In fact, I'd prefer them to be at: internal/commands/build.go. That way we don't unnecessarily pull images, perform downloads, etc and then the action will fail anyway.

I'm glad that you tackled the edge case for us though 🙂

Copy link
Member Author

Choose a reason for hiding this comment

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

Again, I added the test here because it was mentioned in the issue. 😅

I believe I can add the logic to internal/commands/build.go, but I don't get how to move the tests. Aren't the tests for this file in internal/commands/build_test.go, which is the file we're talking about here? Or would the logic of checking for invalid previous-image passed remove the need for a test? 😅

cc: @jromero

But for the sake of better understanding, I'd like to understand the error message.

Mock assertions are always painful to read. In this case, it's complaining that your mock received a call, but your test setup did not have the relevant mockClient.EXPECT() line.

When I have the mockClient line, I got the error "expected error but got nil". I tried it with various registry names, but got the same result. For example, with previous image name example.io/some/previous-image and image name index.docker.io/some/image:latest. Apologies if this information is insufficient.

Also, thank you so much for helping me with this PR, really appreciate it 😄

Copy link
Member

Choose a reason for hiding this comment

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

Just sent you a DM on slack if you want to do a bit of pair programing to get past this little hurdle.

@jromero jromero modified the milestones: 0.20.0, 0.21.0 Jul 14, 2021
Signed-off-by: Ujjwal Goyal <importujjwal@gmail.com>
Signed-off-by: Ujjwal Goyal <importujjwal@gmail.com>
Signed-off-by: Ujjwal Goyal <importujjwal@gmail.com>
Signed-off-by: Ujjwal Goyal <importujjwal@gmail.com>
Signed-off-by: Ujjwal Goyal <importujjwal@gmail.com>
@github-actions github-actions bot removed the type/chore Issue that requests non-user facing changes. label Aug 1, 2021
@github-actions github-actions bot modified the milestones: 0.21.0, 0.20.0 Aug 1, 2021
@importhuman
Copy link
Member Author

importhuman commented Aug 1, 2021

Some tests are failing in the TestLifecycleExecution suite, but none of the failing tests are ones I've added. I updated my local branch with the latest changes in the main branch, could this be the reason?
cc: @jromero

Edit: I ran the tests for my changes in a backup branch I had without pulling the latest changes from the main branch (i.e. only my additions), and got the same test failures. However, I don't get any failures for the main branch itself, i.e. without my code. Following are the failed test results (for backup branch, without latest upstream changes).

EDIT 2: Figured out the problem, pushing commit soon. (Leaving the test results as they were)

➜  pack git:(backup) ✗ go test -v internal/build/lifecycle_execution_test.go
=== RUN   TestLifecycleExecution
Suite: phases
Total: 109 | Focused: 0 | Pending: 0
=== RUN   TestLifecycleExecution/phases
=== RUN   TestLifecycleExecution/phases/#NewLifecycleExecution/lifecycle_supports_multiple_platform_APIs/select_the_latest_supported_version
=== RUN   TestLifecycleExecution/phases/#NewLifecycleExecution/supported_platform_API_is_deprecated/select_the_deprecated_version
=== RUN   TestLifecycleExecution/phases/#NewLifecycleExecution/pack_doesn't_support_any_lifecycle_supported_platform_API/errors
=== RUN   TestLifecycleExecution/phases/Run/Run_using_creator/succeeds
=== RUN   TestLifecycleExecution/phases/Run/Run_using_creator/Run_with_workspace_dir/succeeds
=== RUN   TestLifecycleExecution/phases/Run/Run_without_using_creator/succeeds
=== RUN   TestLifecycleExecution/phases/Run/Run_without_using_creator/Run_with_workspace_dir/succeeds
=== RUN   TestLifecycleExecution/phases/Run/Error_cases/passed_invalid_cache-image/fails
=== RUN   TestLifecycleExecution/phases/#Create/creates_a_phase_and_then_run_it
    lifecycle_execution_test.go:303: Expected nil: image can't be nil
=== RUN   TestLifecycleExecution/phases/#Create/configures_the_phase_with_the_expected_arguments

    lifecycle_execution_test.go:316: Expected nil: image can't be nil
=== RUN   TestLifecycleExecution/phases/#Create/configures_the_phase_with_the_expected_network_mode

    lifecycle_execution_test.go:337: Expected nil: image can't be nil

=== RUN   TestLifecycleExecution/phases/#Create/clear_cache/configures_the_phase_with_the_expected_arguments
    lifecycle_execution_test.go:352: Expected nil: image can't be nil

=== RUN   TestLifecycleExecution/phases/#Create/clear_cache_is_false/configures_the_phase_with_the_expected_arguments
    lifecycle_execution_test.go:372: Expected nil: image can't be nil

=== RUN   TestLifecycleExecution/phases/#Create/using_a_cache_image/configures_the_phase_with_the_expected_arguments
    lifecycle_execution_test.go:396: Expected nil: image can't be nil
=== RUN   TestLifecycleExecution/phases/#Create/additional_tags_are_specified/configures_phases_with_additional_tags

    lifecycle_execution_test.go:420: Expected nil: image can't be nil

=== RUN   TestLifecycleExecution/phases/#Create/publish/configures_the_phase_with_binds
    lifecycle_execution_test.go:455: Expected nil: image can't be nil

=== RUN   TestLifecycleExecution/phases/#Create/publish/configures_the_phase_with_root
    lifecycle_execution_test.go:469: Expected nil: image can't be nil
=== RUN   TestLifecycleExecution/phases/#Create/publish/configures_the_phase_with_registry_access

    lifecycle_execution_test.go:484: Expected nil: image can't be nil
=== RUN   TestLifecycleExecution/phases/#Create/publish/using_a_cache_image/configures_the_phase_with_the_expected_arguments

    lifecycle_execution_test.go:504: Expected nil: image can't be nil
=== RUN   TestLifecycleExecution/phases/#Create/publish/platform_0.3/doesn't_hint_at_default_process_type

=== RUN   TestLifecycleExecution/phases/#Create/publish/platform_0.4/hints_at_default_process_type
=== RUN   TestLifecycleExecution/phases/#Create/publish/platform_>=_0.6/no_user_provided_process_type_is_present/doesn't_provide_'web'_as_default_process_type
=== RUN   TestLifecycleExecution/phases/#Create/publish_is_false/configures_the_phase_with_the_expected_arguments
    lifecycle_execution_test.go:611: Expected nil: image can't be nil
=== RUN   TestLifecycleExecution/phases/#Create/publish_is_false/configures_the_phase_with_daemon_access

    lifecycle_execution_test.go:630: Expected nil: image can't be nil

=== RUN   TestLifecycleExecution/phases/#Create/publish_is_false/configures_the_phase_with_daemon_access_with_tcp_docker-host
    lifecycle_execution_test.go:645: Expected nil: image can't be nil

=== RUN   TestLifecycleExecution/phases/#Create/publish_is_false/configures_the_phase_with_daemon_access_with_alternative_unix_socket_docker-host
    lifecycle_execution_test.go:660: Expected nil: image can't be nil

=== RUN   TestLifecycleExecution/phases/#Create/publish_is_false/configures_the_phase_with_daemon_access_with_alternative_windows_pipe_docker-host
    lifecycle_execution_test.go:674: Expected nil: image can't be nil

=== RUN   TestLifecycleExecution/phases/#Create/publish_is_false/environment_variable_DOCKER_HOST_is_set/configures_the_phase_with_daemon_access_with_inherited_docker-host
    lifecycle_execution_test.go:705: Expected nil: image can't be nil
=== RUN   TestLifecycleExecution/phases/#Create/publish_is_false/configures_the_phase_with_daemon_access_with_docker-host_with_unknown_protocol

    lifecycle_execution_test.go:719: Expected nil: image can't be nil
=== RUN   TestLifecycleExecution/phases/#Create/publish_is_false/configures_the_phase_with_binds

    lifecycle_execution_test.go:735: Expected nil: image can't be nil
=== RUN   TestLifecycleExecution/phases/#Create/publish_is_false/platform_0.3/doesn't_hint_at_default_process_type

=== RUN   TestLifecycleExecution/phases/#Create/publish_is_false/platform_0.4/hints_at_default_process_type
=== RUN   TestLifecycleExecution/phases/#Create/publish_is_false/platform_>=_0.6/no_user_provided_process_type_is_present/doesn't_provide_'web'_as_default_process_type
=== RUN   TestLifecycleExecution/phases/#Create/override_GID/override_GID_is_provided/configures_the_phase_with_the_expected_arguments
    lifecycle_execution_test.go:810: Expected nil: image can't be nil

=== RUN   TestLifecycleExecution/phases/#Create/override_GID/override_GID_is_not_provided/gid_is_not_added_to_the_expected_arguments
    lifecycle_execution_test.go:831: Expected nil: image can't be nil
=== RUN   TestLifecycleExecution/phases/#Create/image_is_invalid/errors

=== RUN   TestLifecycleExecution/phases/#Create/-previous-image_is_used/previous-image_is_invalid/errors
=== RUN   TestLifecycleExecution/phases/#Create/-previous-image_is_used/--publish_is_false/passes_previous-image_to_creator
=== RUN   TestLifecycleExecution/phases/#Create/-previous-image_is_used/--publish_is_true/previous-image_and_image_are_in_the_same_registry/successfully_passes_previous-image_to_creator
=== RUN   TestLifecycleExecution/phases/#Create/-previous-image_is_used/--publish_is_true/previous-image_and_image_are_not_in_the_same_registry/errors
=== RUN   TestLifecycleExecution/phases/#Detect/creates_a_phase_and_then_runs_it
=== RUN   TestLifecycleExecution/phases/#Detect/configures_the_phase_with_the_expected_arguments
=== RUN   TestLifecycleExecution/phases/#Detect/configures_the_phase_with_the_expected_network_mode
=== RUN   TestLifecycleExecution/phases/#Detect/configures_the_phase_to_copy_app_dir
=== RUN   TestLifecycleExecution/phases/#Analyze/creates_a_phase_and_then_runs_it
=== RUN   TestLifecycleExecution/phases/#Analyze/clear_cache/configures_the_phase_with_the_expected_arguments
=== RUN   TestLifecycleExecution/phases/#Analyze/clear_cache_is_false/configures_the_phase_with_the_expected_arguments
=== RUN   TestLifecycleExecution/phases/#Analyze/using_a_cache_image/configures_the_phase_with_a_build_cache_images
=== RUN   TestLifecycleExecution/phases/#Analyze/using_a_cache_image/clear-cache/cache_is_omitted_from_Analyze
=== RUN   TestLifecycleExecution/phases/#Analyze/publish/runs_the_phase_with_the_lifecycle_image
=== RUN   TestLifecycleExecution/phases/#Analyze/publish/sets_the_CNB_USER_ID_and_CNB_GROUP_ID_in_the_environment
=== RUN   TestLifecycleExecution/phases/#Analyze/publish/configures_the_phase_with_registry_access
=== RUN   TestLifecycleExecution/phases/#Analyze/publish/configures_the_phase_with_root
=== RUN   TestLifecycleExecution/phases/#Analyze/publish/configures_the_phase_with_the_expected_arguments
=== RUN   TestLifecycleExecution/phases/#Analyze/publish/configures_the_phase_with_binds
=== RUN   TestLifecycleExecution/phases/#Analyze/publish/using_a_cache_image/configures_the_phase_with_a_build_cache_images
=== RUN   TestLifecycleExecution/phases/#Analyze/publish_is_false/runs_the_phase_with_the_lifecycle_image
=== RUN   TestLifecycleExecution/phases/#Analyze/publish_is_false/sets_the_CNB_USER_ID_and_CNB_GROUP_ID_in_the_environment
=== RUN   TestLifecycleExecution/phases/#Analyze/publish_is_false/configures_the_phase_with_daemon_access
=== RUN   TestLifecycleExecution/phases/#Analyze/publish_is_false/configures_the_phase_with_daemon_access_with_TCP_docker-host
=== RUN   TestLifecycleExecution/phases/#Analyze/publish_is_false/configures_the_phase_with_the_expected_arguments
=== RUN   TestLifecycleExecution/phases/#Analyze/publish_is_false/configures_the_phase_with_the_expected_network_mode
=== RUN   TestLifecycleExecution/phases/#Analyze/publish_is_false/configures_the_phase_with_binds
=== RUN   TestLifecycleExecution/phases/#Analyze/override_GID/override_GID_is_provided/configures_the_phase_with_the_expected_arguments
=== RUN   TestLifecycleExecution/phases/#Analyze/override_GID/override_GID_is_not_provided/gid_is_not_added_to_the_expected_arguments
=== RUN   TestLifecycleExecution/phases/#Restore/runs_the_phase_with_the_lifecycle_image
=== RUN   TestLifecycleExecution/phases/#Restore/sets_the_CNB_USER_ID_and_CNB_GROUP_ID_in_the_environment
=== RUN   TestLifecycleExecution/phases/#Restore/creates_a_phase_and_then_runs_it
=== RUN   TestLifecycleExecution/phases/#Restore/configures_the_phase_with_root_access
=== RUN   TestLifecycleExecution/phases/#Restore/configures_the_phase_with_the_expected_arguments
=== RUN   TestLifecycleExecution/phases/#Restore/configures_the_phase_with_the_expected_network_mode
=== RUN   TestLifecycleExecution/phases/#Restore/configures_the_phase_with_binds
=== RUN   TestLifecycleExecution/phases/#Restore/using_cache_image/configures_the_phase_with_a_cache_image
=== RUN   TestLifecycleExecution/phases/#Restore/override_GID/override_GID_is_provided/configures_the_phase_with_the_expected_arguments
=== RUN   TestLifecycleExecution/phases/#Restore/override_GID/override_GID_is_not_provided/gid_is_not_added_to_the_expected_arguments
=== RUN   TestLifecycleExecution/phases/#Build/creates_a_phase_and_then_runs_it
=== RUN   TestLifecycleExecution/phases/#Build/configures_the_phase_with_the_expected_arguments
=== RUN   TestLifecycleExecution/phases/#Build/configures_the_phase_with_the_expected_network_mode
=== RUN   TestLifecycleExecution/phases/#Build/configures_the_phase_with_binds
=== RUN   TestLifecycleExecution/phases/#Export/creates_a_phase_and_then_runs_it
=== RUN   TestLifecycleExecution/phases/#Export/configures_the_phase_with_the_expected_arguments
=== RUN   TestLifecycleExecution/phases/#Export/additional_tags_are_specified/passes_tag_arguments_to_the_exporter
=== RUN   TestLifecycleExecution/phases/#Export/using_cache_image/configures_phase_with_cache_image
=== RUN   TestLifecycleExecution/phases/#Export/publish/runs_the_phase_with_the_lifecycle_image
=== RUN   TestLifecycleExecution/phases/#Export/publish/sets_the_CNB_USER_ID_and_CNB_GROUP_ID_in_the_environment
=== RUN   TestLifecycleExecution/phases/#Export/publish/configures_the_phase_with_registry_access
=== RUN   TestLifecycleExecution/phases/#Export/publish/configures_the_phase_with_root
=== RUN   TestLifecycleExecution/phases/#Export/publish/configures_the_phase_with_the_expected_network_mode
=== RUN   TestLifecycleExecution/phases/#Export/publish/configures_the_phase_with_binds
=== RUN   TestLifecycleExecution/phases/#Export/publish/configures_the_phase_to_write_stack_toml
=== RUN   TestLifecycleExecution/phases/#Export/publish/configures_the_phase_with_default_process_type
=== RUN   TestLifecycleExecution/phases/#Export/publish/using_cache_image_and_publishing/configures_phase_with_cache_image
=== RUN   TestLifecycleExecution/phases/#Export/publish/platform_0.3/doesn't_hint_at_default_process_type
=== RUN   TestLifecycleExecution/phases/#Export/publish/platform_0.4/hints_at_default_process_type
=== RUN   TestLifecycleExecution/phases/#Export/publish/platform_>=_0.6/no_user_provided_process_type_is_present/doesn't_provide_'web'_as_default_process_type
=== RUN   TestLifecycleExecution/phases/#Export/publish_is_false/runs_the_phase_with_the_lifecycle_image
=== RUN   TestLifecycleExecution/phases/#Export/publish_is_false/sets_the_CNB_USER_ID_and_CNB_GROUP_ID_in_the_environment
=== RUN   TestLifecycleExecution/phases/#Export/publish_is_false/configures_the_phase_with_daemon_access
=== RUN   TestLifecycleExecution/phases/#Export/publish_is_false/configures_the_phase_with_daemon_access_with_tcp_docker-host
=== RUN   TestLifecycleExecution/phases/#Export/publish_is_false/configures_the_phase_with_the_expected_arguments
=== RUN   TestLifecycleExecution/phases/#Export/publish_is_false/configures_the_phase_with_the_expected_network_mode
=== RUN   TestLifecycleExecution/phases/#Export/publish_is_false/configures_the_phase_with_binds
=== RUN   TestLifecycleExecution/phases/#Export/publish_is_false/configures_the_phase_to_write_stack_toml
=== RUN   TestLifecycleExecution/phases/#Export/publish_is_false/configures_the_phase_with_default_process_type
=== RUN   TestLifecycleExecution/phases/#Export/publish_is_false/platform_0.3/doesn't_hint_at_default_process_type
=== RUN   TestLifecycleExecution/phases/#Export/publish_is_false/platform_0.4/hints_at_default_process_type
=== RUN   TestLifecycleExecution/phases/#Export/publish_is_false/platform_>=_0.6/no_user_provided_process_type_is_present/doesn't_provide_'web'_as_default_process_type
=== RUN   TestLifecycleExecution/phases/#Export/override_GID/override_GID_is_provided/configures_the_phase_with_the_expected_arguments
=== RUN   TestLifecycleExecution/phases/#Export/override_GID/override_GID_is_not_provided/gid_is_not_added_to_the_expected_arguments

Passed: 88 | Failed: 21 | Skipped: 0

--- FAIL: TestLifecycleExecution (0.06s)
    --- FAIL: TestLifecycleExecution/phases (0.06s)
        --- PASS: TestLifecycleExecution/phases/#NewLifecycleExecution/lifecycle_supports_multiple_platform_APIs/select_the_latest_supported_version (0.00s)
        --- PASS: TestLifecycleExecution/phases/#NewLifecycleExecution/supported_platform_API_is_deprecated/select_the_deprecated_version (0.00s)
        --- PASS: TestLifecycleExecution/phases/#NewLifecycleExecution/pack_doesn't_support_any_lifecycle_supported_platform_API/errors (0.00s)
        --- PASS: TestLifecycleExecution/phases/Run/Run_using_creator/succeeds (0.00s)
        --- PASS: TestLifecycleExecution/phases/Run/Run_using_creator/Run_with_workspace_dir/succeeds (0.00s)
        --- PASS: TestLifecycleExecution/phases/Run/Run_without_using_creator/succeeds (0.00s)
        --- PASS: TestLifecycleExecution/phases/Run/Run_without_using_creator/Run_with_workspace_dir/succeeds (0.00s)
        --- PASS: TestLifecycleExecution/phases/Run/Error_cases/passed_invalid_cache-image/fails (0.00s)
        --- FAIL: TestLifecycleExecution/phases/#Create/creates_a_phase_and_then_run_it (0.00s)
        --- FAIL: TestLifecycleExecution/phases/#Create/configures_the_phase_with_the_expected_arguments (0.00s)
        --- FAIL: TestLifecycleExecution/phases/#Create/configures_the_phase_with_the_expected_network_mode (0.00s)
        --- FAIL: TestLifecycleExecution/phases/#Create/clear_cache/configures_the_phase_with_the_expected_arguments (0.00s)
        --- FAIL: TestLifecycleExecution/phases/#Create/clear_cache_is_false/configures_the_phase_with_the_expected_arguments (0.00s)
        --- FAIL: TestLifecycleExecution/phases/#Create/using_a_cache_image/configures_the_phase_with_the_expected_arguments (0.00s)
        --- FAIL: TestLifecycleExecution/phases/#Create/additional_tags_are_specified/configures_phases_with_additional_tags (0.00s)
        --- FAIL: TestLifecycleExecution/phases/#Create/publish/configures_the_phase_with_binds (0.00s)
        --- FAIL: TestLifecycleExecution/phases/#Create/publish/configures_the_phase_with_root (0.00s)
        --- FAIL: TestLifecycleExecution/phases/#Create/publish/configures_the_phase_with_registry_access (0.00s)
        --- FAIL: TestLifecycleExecution/phases/#Create/publish/using_a_cache_image/configures_the_phase_with_the_expected_arguments (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Create/publish/platform_0.3/doesn't_hint_at_default_process_type (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Create/publish/platform_0.4/hints_at_default_process_type (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Create/publish/platform_>=_0.6/no_user_provided_process_type_is_present/doesn't_provide_'web'_as_default_process_type (0.00s)
        --- FAIL: TestLifecycleExecution/phases/#Create/publish_is_false/configures_the_phase_with_the_expected_arguments (0.00s)
        --- FAIL: TestLifecycleExecution/phases/#Create/publish_is_false/configures_the_phase_with_daemon_access (0.00s)
        --- FAIL: TestLifecycleExecution/phases/#Create/publish_is_false/configures_the_phase_with_daemon_access_with_tcp_docker-host (0.00s)
        --- FAIL: TestLifecycleExecution/phases/#Create/publish_is_false/configures_the_phase_with_daemon_access_with_alternative_unix_socket_docker-host (0.00s)
        --- FAIL: TestLifecycleExecution/phases/#Create/publish_is_false/configures_the_phase_with_daemon_access_with_alternative_windows_pipe_docker-host (0.00s)
        --- FAIL: TestLifecycleExecution/phases/#Create/publish_is_false/environment_variable_DOCKER_HOST_is_set/configures_the_phase_with_daemon_access_with_inherited_docker-host (0.00s)
        --- FAIL: TestLifecycleExecution/phases/#Create/publish_is_false/configures_the_phase_with_daemon_access_with_docker-host_with_unknown_protocol (0.00s)
        --- FAIL: TestLifecycleExecution/phases/#Create/publish_is_false/configures_the_phase_with_binds (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Create/publish_is_false/platform_0.3/doesn't_hint_at_default_process_type (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Create/publish_is_false/platform_0.4/hints_at_default_process_type (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Create/publish_is_false/platform_>=_0.6/no_user_provided_process_type_is_present/doesn't_provide_'web'_as_default_process_type (0.00s)
        --- FAIL: TestLifecycleExecution/phases/#Create/override_GID/override_GID_is_provided/configures_the_phase_with_the_expected_arguments (0.00s)
        --- FAIL: TestLifecycleExecution/phases/#Create/override_GID/override_GID_is_not_provided/gid_is_not_added_to_the_expected_arguments (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Create/image_is_invalid/errors (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Create/-previous-image_is_used/previous-image_is_invalid/errors (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Create/-previous-image_is_used/--publish_is_false/passes_previous-image_to_creator (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Create/-previous-image_is_used/--publish_is_true/previous-image_and_image_are_in_the_same_registry/successfully_passes_previous-image_to_creator (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Create/-previous-image_is_used/--publish_is_true/previous-image_and_image_are_not_in_the_same_registry/errors (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Detect/creates_a_phase_and_then_runs_it (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Detect/configures_the_phase_with_the_expected_arguments (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Detect/configures_the_phase_with_the_expected_network_mode (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Detect/configures_the_phase_to_copy_app_dir (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Analyze/creates_a_phase_and_then_runs_it (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Analyze/clear_cache/configures_the_phase_with_the_expected_arguments (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Analyze/clear_cache_is_false/configures_the_phase_with_the_expected_arguments (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Analyze/using_a_cache_image/configures_the_phase_with_a_build_cache_images (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Analyze/using_a_cache_image/clear-cache/cache_is_omitted_from_Analyze (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Analyze/publish/runs_the_phase_with_the_lifecycle_image (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Analyze/publish/sets_the_CNB_USER_ID_and_CNB_GROUP_ID_in_the_environment (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Analyze/publish/configures_the_phase_with_registry_access (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Analyze/publish/configures_the_phase_with_root (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Analyze/publish/configures_the_phase_with_the_expected_arguments (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Analyze/publish/configures_the_phase_with_binds (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Analyze/publish/using_a_cache_image/configures_the_phase_with_a_build_cache_images (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Analyze/publish_is_false/runs_the_phase_with_the_lifecycle_image (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Analyze/publish_is_false/sets_the_CNB_USER_ID_and_CNB_GROUP_ID_in_the_environment (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Analyze/publish_is_false/configures_the_phase_with_daemon_access (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Analyze/publish_is_false/configures_the_phase_with_daemon_access_with_TCP_docker-host (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Analyze/publish_is_false/configures_the_phase_with_the_expected_arguments (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Analyze/publish_is_false/configures_the_phase_with_the_expected_network_mode (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Analyze/publish_is_false/configures_the_phase_with_binds (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Analyze/override_GID/override_GID_is_provided/configures_the_phase_with_the_expected_arguments (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Analyze/override_GID/override_GID_is_not_provided/gid_is_not_added_to_the_expected_arguments (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Restore/runs_the_phase_with_the_lifecycle_image (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Restore/sets_the_CNB_USER_ID_and_CNB_GROUP_ID_in_the_environment (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Restore/creates_a_phase_and_then_runs_it (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Restore/configures_the_phase_with_root_access (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Restore/configures_the_phase_with_the_expected_arguments (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Restore/configures_the_phase_with_the_expected_network_mode (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Restore/configures_the_phase_with_binds (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Restore/using_cache_image/configures_the_phase_with_a_cache_image (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Restore/override_GID/override_GID_is_provided/configures_the_phase_with_the_expected_arguments (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Restore/override_GID/override_GID_is_not_provided/gid_is_not_added_to_the_expected_arguments (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Build/creates_a_phase_and_then_runs_it (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Build/configures_the_phase_with_the_expected_arguments (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Build/configures_the_phase_with_the_expected_network_mode (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Build/configures_the_phase_with_binds (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Export/creates_a_phase_and_then_runs_it (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Export/configures_the_phase_with_the_expected_arguments (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Export/additional_tags_are_specified/passes_tag_arguments_to_the_exporter (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Export/using_cache_image/configures_phase_with_cache_image (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Export/publish/runs_the_phase_with_the_lifecycle_image (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Export/publish/sets_the_CNB_USER_ID_and_CNB_GROUP_ID_in_the_environment (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Export/publish/configures_the_phase_with_registry_access (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Export/publish/configures_the_phase_with_root (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Export/publish/configures_the_phase_with_the_expected_network_mode (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Export/publish/configures_the_phase_with_binds (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Export/publish/configures_the_phase_to_write_stack_toml (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Export/publish/configures_the_phase_with_default_process_type (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Export/publish/using_cache_image_and_publishing/configures_phase_with_cache_image (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Export/publish/platform_0.3/doesn't_hint_at_default_process_type (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Export/publish/platform_0.4/hints_at_default_process_type (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Export/publish/platform_>=_0.6/no_user_provided_process_type_is_present/doesn't_provide_'web'_as_default_process_type (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Export/publish_is_false/runs_the_phase_with_the_lifecycle_image (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Export/publish_is_false/sets_the_CNB_USER_ID_and_CNB_GROUP_ID_in_the_environment (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Export/publish_is_false/configures_the_phase_with_daemon_access (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Export/publish_is_false/configures_the_phase_with_daemon_access_with_tcp_docker-host (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Export/publish_is_false/configures_the_phase_with_the_expected_arguments (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Export/publish_is_false/configures_the_phase_with_the_expected_network_mode (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Export/publish_is_false/configures_the_phase_with_binds (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Export/publish_is_false/configures_the_phase_to_write_stack_toml (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Export/publish_is_false/configures_the_phase_with_default_process_type (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Export/publish_is_false/platform_0.3/doesn't_hint_at_default_process_type (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Export/publish_is_false/platform_0.4/hints_at_default_process_type (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Export/publish_is_false/platform_>=_0.6/no_user_provided_process_type_is_present/doesn't_provide_'web'_as_default_process_type (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Export/override_GID/override_GID_is_provided/configures_the_phase_with_the_expected_arguments (0.00s)
        --- PASS: TestLifecycleExecution/phases/#Export/override_GID/override_GID_is_not_provided/gid_is_not_added_to_the_expected_arguments (0.00s)
FAIL
FAIL	command-line-arguments	0.085s
FAIL

@jromero jromero modified the milestones: 0.20.0, 0.21.0 Aug 9, 2021
Resolves buildpacks#897

Signed-off-by: Ujjwal Goyal <importujjwal@gmail.com>
@importhuman
Copy link
Member Author

@jromero How can I fix the tests failing at the "no test files" stage? Other than this, the PR should be good to go. I've put back the image validation portion inside the condition as it was before, otherwise the tests were failing since not all of them were provided with images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Issue that requests a new feature or improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants