Blame SOURCES/0001-tests-Update-tests-for-osbuild-composer-changes.patch

58f0ac
From b1d63edcd830a5a23eaa838f536769681db24acb Mon Sep 17 00:00:00 2001
58f0ac
From: "Brian C. Lane" <bcl@redhat.com>
58f0ac
Date: Tue, 14 Jun 2022 13:43:45 -0700
58f0ac
Subject: [PATCH] tests: Update tests for osbuild-composer changes
58f0ac
58f0ac
Cancel when the build is in the wrong state now returns a proper error,
58f0ac
and ostree composes now accept the refid, parent, and the url without
58f0ac
returning an error.
58f0ac
---
58f0ac
 weldr/compose_test.go | 12 +++++-------
58f0ac
 1 file changed, 5 insertions(+), 7 deletions(-)
58f0ac
58f0ac
diff --git a/weldr/compose_test.go b/weldr/compose_test.go
58f0ac
index f937510..fb2fa42 100644
58f0ac
--- a/weldr/compose_test.go
58f0ac
+++ b/weldr/compose_test.go
58f0ac
@@ -97,14 +97,12 @@ func TestStartOSTreeComposeUrl(t *testing.T) {
58f0ac
 	assert.Greater(t, len(id), 0)
58f0ac
 }
58f0ac
 
58f0ac
-func TestStartOSTreeComposeUrlError(t *testing.T) {
58f0ac
-	// Sending both the parent url and the parent id should return an error
58f0ac
+func TestStartOSTreeUrlParentError(t *testing.T) {
58f0ac
+	// Sending both the parent url and the parent id is now allowed
58f0ac
 	id, r, err := testState.client.StartOSTreeComposeTest("cli-test-bp-1", "qcow2", "refid", "parent", "http://weldr.io", 0, 2)
58f0ac
 	require.Nil(t, err)
58f0ac
-	require.NotNil(t, r)
58f0ac
-	assert.False(t, r.Status)
58f0ac
-	assert.Equal(t, APIErrorMsg{"OSTreeOptionsError", "Supply at most one of Parent and URL"}, r.Errors[0])
58f0ac
-	assert.Equal(t, len(id), 0)
58f0ac
+	require.Nil(t, r)
58f0ac
+	assert.Greater(t, len(id), 0)
58f0ac
 }
58f0ac
 
58f0ac
 func TestStartOSTreeComposeUpload(t *testing.T) {
58f0ac
@@ -196,7 +194,7 @@ func TestCancelFinishedCompose(t *testing.T) {
58f0ac
 	require.NotNil(t, status)
58f0ac
 	assert.False(t, status.Status)
58f0ac
 	require.GreaterOrEqual(t, len(r), 1)
58f0ac
-	assert.Equal(t, APIErrorMsg{"InternalServerError", "Internal server error: job does not exist"}, r[0])
58f0ac
+	assert.Equal(t, APIErrorMsg{"BuildInWrongState", fmt.Sprintf("Build %s is not in WAITING or RUNNING.", id)}, r[0])
58f0ac
 }
58f0ac
 
58f0ac
 func TestCancelComposeUnknown(t *testing.T) {
58f0ac
-- 
58f0ac
2.37.1
58f0ac