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

Missing weatherreport-test makefile target on Windows #4376

Open
big-r81 opened this issue Jan 16, 2023 · 1 comment
Open

Missing weatherreport-test makefile target on Windows #4376

big-r81 opened this issue Jan 16, 2023 · 1 comment

Comments

@big-r81
Copy link
Contributor

big-r81 commented Jan 16, 2023

Description

The make target weatherreport-test is missing on Windows and needs to be backported
from the *nix makefile target.

Steps to Reproduce

Run this on Windows:

PS C:\relax\couchdb> make -f Makefile.win weatherreport-test

Output:

make: *** No rule to make target 'weatherreport-test'.  Stop.

Expected Behaviour

Should run the test like the makefile target on *nix:

[ * ] Running cluster setup ... ok
[ * ] Exec command bin/weatherreport --etc dev/lib/node1/etc --level error ... No diagnostic messages to report.

Your Environment

  • CouchDB version used: a14922f
  • Operating system and version: Windows Server 2022
@big-r81 big-r81 changed the title Missing wheaterreport-test makefile target on Windows Missing weatherreport-test makefile target on Windows Jan 16, 2023
@big-r81
Copy link
Contributor Author

big-r81 commented Jan 18, 2023

Update:

Discussion with Robert on Slack:

weatherreport was built with Linux in mind and nothing else afaicr
since it was for when Cloudant had customers running a build local to them, we needed a tool to extract basic "wtf" info. and we only permitted installs on Linux.

It seems, the weatherreport needs some linux tools (ps) to work. These needs to be evaluated to find a equivalent for Windows with the same function/command output.

To get weatherreport running, there needs to be added the following files:

bin/weatherreport.cmd (Needs to be created, when CouchDB compiles):

@echo off
escript.exe "%~dpn0" %*

Makefile.win:

index a897554e7..55c4f3b33 100644
--- a/Makefile.win
+++ b/Makefile.win
@@ -97,7 +97,7 @@ TEST_OPTS=-c startup_jitter=0 -c default_security=admin_local

 .PHONY: all
 # target: all - Build everything
-all: couch fauxton docs
+all: couch fauxton docs escriptize


 ################################################################################
@@ -124,6 +124,11 @@ endif
 # target: fauxton - Build Fauxton web UI
 fauxton: share\www

+.PHONY: escriptize
+# target: escriptize - Build CLI tools
+escriptize: couch
+       @$(REBAR) -r escriptize apps=weatherreport
+       @cp src/weatherreport/weatherreport bin/weatherreport

 ################################################################################
 # Testing
@@ -264,6 +269,11 @@ mango-test: devclean all
                .venv\Scripts\pip.exe install -r requirements.txt
        @cd src\mango && .venv\Scripts\python.exe ..\..\dev\run -n 1 --admin=testuser:testpass .venv\Scripts\nose2

+.PHONY: weatherreport-test
+# target: weatherreport-test - Run weatherreport against dev cluster
+weatherreport-test: devclean escriptize
+       @dev\run -n 1 -a adm:pass --no-eval \
+               'bin\weatherreport --etc dev\lib\node1\etc --level error'

 ################################################################################
 # Developing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant