Skip to content

Commit 2145319

Browse files
committed
Replace brew test with direct test commands
Problem: `brew test` requires strict version matching between installed formula and tap's git history, which is difficult to satisfy with temporary taps. Repeated failures with "Testing requires the latest version" error. Solution: Skip `brew test` wrapper entirely and run test commands directly. This approach: 1. Removes unnecessary git commit step (no longer needed) 2. Consolidates all tests into one comprehensive step 3. Tests match the formula's test block exactly: - Binary existence and executability - Installation structure (mfc.sh, toolchain) - Python venv setup - Examples installation - mfc wrapper functionality (--help, count) 4. Removes redundant "Verify installation structure" step 5. Still runs full simulation test case This is more robust and avoids Homebrew's internal version checking mechanisms that aren't designed for temporary tap workflows.
1 parent 56083b9 commit 2145319

File tree

1 file changed

+33
-44
lines changed

1 file changed

+33
-44
lines changed

.github/workflows/homebrew.yml

Lines changed: 33 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,6 @@ jobs:
5050
echo "Copying formula to tap..."
5151
cp packaging/homebrew/mfc.rb $(brew --repository)/Library/Taps/mflowcode/homebrew-test/Formula/mfc.rb
5252
53-
echo "Committing formula to tap..."
54-
cd $(brew --repository)/Library/Taps/mflowcode/homebrew-test
55-
git add Formula/mfc.rb
56-
git commit -m "Add MFC formula"
57-
cd -
58-
5953
echo "Installing MFC from local tap..."
6054
brew install --build-from-source --verbose mflowcode/test/mfc 2>&1 | tee /tmp/brew-install.log
6155
@@ -87,31 +81,43 @@ jobs:
8781
~/Library/Logs/Homebrew/mfc/
8882
if-no-files-found: ignore
8983

90-
- name: Run formula tests
91-
run: |
92-
echo "Running Homebrew formula tests..."
93-
brew test --verbose mflowcode/test/mfc
94-
95-
- name: Test MFC binaries
96-
run: |
97-
echo "Verifying binaries are in PATH and executable..."
98-
which mfc
99-
which pre_process
100-
which simulation
101-
which post_process
102-
test -x $(which mfc)
103-
test -x $(which pre_process)
104-
test -x $(which simulation)
105-
test -x $(which post_process)
106-
echo "All binaries are accessible and executable!"
107-
108-
- name: Test MFC wrapper functionality
84+
- name: Test MFC installation
10985
run: |
110-
echo "Testing mfc command..."
86+
echo "=== Testing MFC Installation ==="
87+
88+
echo "1. Checking binaries exist and are executable..."
89+
test -f $(brew --prefix)/bin/mfc && test -x $(brew --prefix)/bin/mfc
90+
test -f $(brew --prefix)/bin/pre_process && test -x $(brew --prefix)/bin/pre_process
91+
test -f $(brew --prefix)/bin/simulation && test -x $(brew --prefix)/bin/simulation
92+
test -f $(brew --prefix)/bin/post_process && test -x $(brew --prefix)/bin/post_process
93+
echo " ✓ All binaries exist and are executable"
94+
95+
echo "2. Verifying installation structure..."
96+
test -f $(brew --prefix)/libexec/mfc.sh
97+
test -d $(brew --prefix)/share/mfc/toolchain
98+
test -d $(brew --prefix)/share/mfc/toolchain/mfc
99+
echo " ✓ Installation structure verified"
100+
101+
echo "3. Checking Python venv..."
102+
test -d $(brew --prefix)/Cellar/mfc/*/libexec/venv
103+
test -f $(brew --prefix)/Cellar/mfc/*/libexec/venv/bin/python
104+
test -f $(brew --prefix)/Cellar/mfc/*/libexec/venv/bin/pip
105+
echo " ✓ Python venv exists"
106+
107+
echo "4. Checking examples..."
108+
test -d $(brew --prefix)/share/mfc/examples
109+
test -f $(brew --prefix)/share/mfc/examples/1D_sodshocktube/case.py
110+
echo " ✓ Examples installed"
111+
112+
echo "5. Testing mfc wrapper..."
111113
mfc --help
114+
echo " ✓ mfc --help succeeded"
112115
113-
echo "Counting example cases..."
116+
echo "6. Testing mfc count..."
114117
mfc count $(brew --prefix)/share/mfc/examples/1D_sodshocktube/case.py
118+
echo " ✓ mfc count succeeded"
119+
120+
echo "=== All tests passed! ==="
115121
116122
- name: Run MFC test case
117123
run: |
@@ -124,23 +130,6 @@ jobs:
124130
125131
echo "Test case completed successfully!"
126132
127-
- name: Verify installation structure
128-
run: |
129-
echo "Checking installed files..."
130-
ls -la $(brew --prefix)/bin/mfc
131-
ls -la $(brew --prefix)/bin/pre_process
132-
ls -la $(brew --prefix)/bin/simulation
133-
ls -la $(brew --prefix)/bin/post_process
134-
ls -la $(brew --prefix)/libexec/mfc.sh
135-
ls -la $(brew --prefix)/share/mfc/examples/
136-
137-
echo "Checking Python venv..."
138-
ls -la $(brew --prefix)/Cellar/mfc/*/libexec/venv/
139-
$(brew --prefix)/Cellar/mfc/*/libexec/venv/bin/python --version
140-
$(brew --prefix)/Cellar/mfc/*/libexec/venv/bin/pip list | grep -E "(cantera|mfc)"
141-
142-
echo "Installation verified successfully!"
143-
144133
- name: Uninstall and cleanup
145134
if: always()
146135
run: |

0 commit comments

Comments
 (0)