Skip to content

Commit a3c27d2

Browse files
committed
Debug issus in windows build
1 parent 9574061 commit a3c27d2

File tree

3 files changed

+55
-31
lines changed

3 files changed

+55
-31
lines changed

.github/workflows/continuous_integration.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
ruby: [2.7, 3.0, 3.1, head, jruby-9.4.0.0, jruby-head]
18-
operating-system: [ubuntu-latest]
17+
# ruby: [2.7, 3.0, 3.1, head, jruby-9.4.0.0, jruby-head]
18+
# operating-system: [ubuntu-latest]
1919
include:
20-
- ruby: 3.1
21-
operating-system: windows-latest
20+
# - ruby: 3.1
21+
# operating-system: windows-latest
2222
- ruby: jruby-9.4.0.0
2323
operating-system: windows-latest
2424

tests/all_tests.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
Dir.chdir(File.dirname(__FILE__)) do
2-
Dir.glob('**/test_*.rb') do |test_case|
3-
require "#{File.expand_path(File.dirname(__FILE__))}/#{test_case}"
4-
end
5-
end
1+
# Dir.chdir(File.dirname(__FILE__)) do
2+
# Dir.glob('**/test_*.rb') do |test_case|
3+
# require "#{File.expand_path(File.dirname(__FILE__))}/#{test_case}"
4+
# end
5+
# end
66

77
# To run a single test:
8-
# require_relative 'units/test_lib_meets_required_version'
8+
require_relative 'units/test_index_ops'

tests/units/test_index_ops.rb

Lines changed: 45 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,36 @@
33
require File.dirname(__FILE__) + '/../test_helper'
44

55
class TestIndexOps < Test::Unit::TestCase
6-
6+
77
def setup
88
set_file_paths
99
@git = Git.open(@wdir)
1010
end
11-
11+
1212
def test_add
1313
in_temp_dir do |path|
1414
g = Git.clone(@wbare, 'new')
1515
Dir.chdir('new') do
1616
assert_equal('100644', g.status['example.txt'].mode_index)
17-
17+
1818
new_file('test-file', 'blahblahblah')
1919
assert(g.status.untracked.assoc('test-file'))
20-
20+
2121
g.add
2222
assert(g.status.added.assoc('test-file'))
2323
assert(!g.status.untracked.assoc('test-file'))
2424
assert(!g.status.changed.assoc('example.txt'))
25-
25+
2626
new_file('example.txt', 'hahahaha')
2727
assert(g.status.changed.assoc('example.txt'))
28-
28+
2929
g.add
3030
assert(g.status.changed.assoc('example.txt'))
31-
31+
3232
g.commit('my message')
3333
assert(!g.status.changed.assoc('example.txt'))
3434
assert(!g.status.added.assoc('test-file'))
35-
assert(!g.status.untracked.assoc('test-file'))
35+
assert(!g.status.untracked.assoc('test-file'))
3636
assert_equal('hahahaha', g.status['example.txt'].blob.contents)
3737
end
3838
end
@@ -66,13 +66,13 @@ def test_clean
6666
assert(File.exist?('ignored_file'))
6767

6868
g.clean(:force => true)
69-
69+
7070
assert(!File.exist?('file-to-clean'))
7171
assert(File.exist?('dir_to_clean'))
7272
assert(File.exist?('ignored_file'))
7373

7474
new_file('file-to-clean', 'blablahbla')
75-
75+
7676
g.clean(:force => true, :d => true)
7777

7878
assert(!File.exist?('file-to-clean'))
@@ -89,23 +89,47 @@ def test_clean
8989
end
9090
end
9191
end
92-
92+
9393
def test_revert
9494
in_temp_dir do |path|
9595
g = Git.clone(@wbare, 'new')
9696
Dir.chdir('new') do
97+
puts "Log before any commits"
98+
puts '-' * 80
99+
puts `git log`
100+
puts '-' * 80
101+
97102
new_file('test-file', 'blahblahbal')
98103
g.add
99104
g.commit("first commit")
100105
first_commit = g.gcommit('HEAD')
101106

107+
puts "Log after one commit:"
108+
puts '-' * 80
109+
puts `git log`
110+
puts '-' * 80
111+
102112
new_file('test-file2', 'blablahbla')
103113
g.add
104114
g.commit("second-commit")
105115
g.gcommit('HEAD')
106116

117+
puts "Log after two commits:"
118+
puts '-' * 80
119+
puts `git log`
120+
puts '-' * 80
121+
122+
puts "first commit: #{first_commit.sha}"
123+
puts "second commit: #{second_commit.sha}"
124+
107125
commits = g.log(10000).count
108126
g.revert(first_commit.sha)
127+
128+
puts "Log after revert:"
129+
puts '-' * 80
130+
puts `git log`
131+
puts '-' * 80
132+
109133
assert_equal(commits + 1, g.log(10000).count)
110134
assert(!File.exist?('test-file2'))
111135
end
@@ -116,53 +140,53 @@ def test_add_array
116140
in_temp_dir do |path|
117141
g = Git.clone(@wbare, 'new')
118142
Dir.chdir('new') do
119-
143+
120144
new_file('test-file1', 'blahblahblah1')
121145
new_file('test-file2', 'blahblahblah2')
122146
assert(g.status.untracked.assoc('test-file1'))
123-
147+
124148
g.add(['test-file1', 'test-file2'])
125149
assert(g.status.added.assoc('test-file1'))
126150
assert(g.status.added.assoc('test-file1'))
127151
assert(!g.status.untracked.assoc('test-file1'))
128-
152+
129153
g.commit('my message')
130154
assert(!g.status.added.assoc('test-file1'))
131-
assert(!g.status.untracked.assoc('test-file1'))
155+
assert(!g.status.untracked.assoc('test-file1'))
132156
assert_equal('blahblahblah1', g.status['test-file1'].blob.contents)
133157
end
134158
end
135159
end
136-
160+
137161
def test_remove
138162
in_temp_dir do |path|
139163
g = Git.clone(@wbare, 'remove_test')
140164
Dir.chdir('remove_test') do
141165
assert(g.status['example.txt'])
142166
g.remove('example.txt')
143-
assert(g.status.deleted.assoc('example.txt'))
167+
assert(g.status.deleted.assoc('example.txt'))
144168
g.commit('deleted file')
145169
assert(!g.status['example.txt'])
146170
end
147171
end
148172
end
149-
173+
150174
def test_reset
151175
in_temp_dir do |path|
152176
g = Git.clone(@wbare, 'reset_test')
153177
Dir.chdir('reset_test') do
154178
new_file('test-file1', 'blahblahblah1')
155179
new_file('test-file2', 'blahblahblah2')
156180
assert(g.status.untracked.assoc('test-file1'))
157-
181+
158182
g.add(['test-file1', 'test-file2'])
159183
assert(!g.status.untracked.assoc('test-file1'))
160-
184+
161185
g.reset
162186
assert(g.status.untracked.assoc('test-file1'))
163187
assert(!g.status.added.assoc('test-file1'))
164188
end
165189
end
166190
end
167-
191+
168192
end

0 commit comments

Comments
 (0)