The eleventh batch
[git.git] / t / t9829-git-p4-jobs.sh
blob3fc0948d9cff2060381eab9bb8178419d656a157
1 #!/bin/sh
3 test_description='git p4 retrieve job info'
5 TEST_PASSES_SANITIZE_LEAK=true
6 . ./lib-git-p4.sh
8 test_expect_success 'start p4d' '
9 start_p4d
12 test_expect_success 'add p4 jobs' '
14 p4_add_job TESTJOB-A &&
15 p4_add_job TESTJOB-B
19 test_expect_success 'add p4 files' '
20 client_view "//depot/... //client/..." &&
22 cd "$cli" &&
23 >file1 &&
24 p4 add file1 &&
25 p4 submit -d "Add file 1"
29 test_expect_success 'check log message of changelist with no jobs' '
30 client_view "//depot/... //client/..." &&
31 test_when_finished cleanup_git &&
33 cd "$git" &&
34 git init . &&
35 git p4 clone --use-client-spec --destination="$git" //depot@all &&
36 cat >expect <<-\EOF &&
37 Add file 1
38 [git-p4: depot-paths = "//depot/": change = 1]
40 EOF
41 git log --format=%B >actual &&
42 test_cmp expect actual
46 test_expect_success 'add TESTJOB-A to change 1' '
48 cd "$cli" &&
49 p4 fix -c 1 TESTJOB-A
53 test_expect_success 'check log message of changelist with one job' '
54 client_view "//depot/... //client/..." &&
55 test_when_finished cleanup_git &&
57 cd "$git" &&
58 git init . &&
59 git p4 clone --use-client-spec --destination="$git" //depot@all &&
60 cat >expect <<-\EOF &&
61 Add file 1
62 Jobs: TESTJOB-A
63 [git-p4: depot-paths = "//depot/": change = 1]
65 EOF
66 git log --format=%B >actual &&
67 test_cmp expect actual
71 test_expect_success 'add TESTJOB-B to change 1' '
73 cd "$cli" &&
74 p4 fix -c 1 TESTJOB-B
78 test_expect_success 'check log message of changelist with more jobs' '
79 client_view "//depot/... //client/..." &&
80 test_when_finished cleanup_git &&
82 cd "$git" &&
83 git init . &&
84 git p4 clone --use-client-spec --destination="$git" //depot@all &&
85 cat >expect <<-\EOF &&
86 Add file 1
87 Jobs: TESTJOB-A TESTJOB-B
88 [git-p4: depot-paths = "//depot/": change = 1]
90 EOF
91 git log --format=%B >actual &&
92 test_cmp expect actual
96 test_done