-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
fix(tests): improve tests and add DEVELOPMENT.md docs #111
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic, thank you! This is very helpful. I'm not sure if it is just my setup, but running node test/test.js host all
fails on my local with:
Error: Cannot find module '@yao-pkg/pkg-fetch/lib-es5/upload.js'
Choosing only-npm
seems to bypass that error.
@q0rban try to run |
@igorklopov I would like to start improving tests as right now they are very slow. I'm wondering if you have some ideas about how them could be improved, I tried looking at them but some are so big and nested especially npm related ones |
I think they can be parallelized. IIRC they don't overlap. |
I did a try on #3 without success. Will try again now once I can reach a working state :) |
I just tested this with a Makefile, and it fails almost immediately with concurrency of 4: # Possible values are nodeXX (e.g. node20), or "host" to use the host-installed
# node version. Defaults to "host".
TARGET ?= host
ALL_FLAVORS := $(patsubst test/%/main.js,%,$(wildcard test/**/main.js))
NO_NPM := $(filter-out test-79-npm%,$(ALL_FLAVORS))
ONLY_NPM := "test-42-fetch-all" "test-46-multi-arch" "test-46-multi-arch-2" "test-10-pnpm" "test-11-pnpm" "test-80-compression-node-opcua" "test-99-\#1135" "test-99-\#1191" "test-99-\#1192" "test-00-sea"
.PHONY: all
all: $(ALL_FLAVORS)
.PHONY: test-%
test-%:
@if [[ -z "$(wildcard test/test-$(*)*/main.js)" ]]; then \
echo "Unable to find test/test-$(*)*/main.js)"; \
exit 1; \
fi
node test/test.js $(TARGET) $(@)
.PHONY: no-npm
no-npm:
$(MAKE) $(NO_NPM)
.PHONY: only-npm
only-npm:
$(MAKE) $(ONLY_NPM)
This fails with a complicated mess of errors ^^ However, this runs just fine:
|
I tried to spawn tests in parallel here: #115 Seems no benefit at all, tried with different concurrency as well, they run but some are not consistent as pnpm doesn't support concurrent install, same for codesign (tests are failing almost always on macos) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quando se trata de automação de testes, algumas ferramentas se destacam bastante. O Selenium é super popular, especialmente para testes de aplicações web, porque é flexível e suporta várias linguagens de programação. Se você está trabalhando com Java, o JUnit é uma escolha clássica para testes unitários, oferecendo uma integração suave com muitos ambientes de desenvolvimento.
@SonyK16 It's not clear to me how your comment could be helpful |
I think it's a bot / spam |
No description provided.