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

Describe local test run #658

Closed
DifferentialOrange opened this issue Nov 9, 2021 · 1 comment · Fixed by #669
Closed

Describe local test run #658

DifferentialOrange opened this issue Nov 9, 2021 · 1 comment · Fixed by #669
Assignees
Labels
code health Improve code readability, simplify maintenance and so on documentation Improvements or additions to documentation

Comments

@DifferentialOrange
Copy link
Member

There are no descriptions or prepared scripts (like make-commands) for test run. Setting up test environment requires using mage -- it is not a default go mod tidy; go test . run and not obvious for one unfamiliar with mage. Running a sequence of commands from CI was not enough for me: it failed with

Running unit tests...
../generate_templates_vfs.go:9:2: no required module provides package github.com/shurcooL/vfsgen; to add it:
	go get github.com/shurcooL/vfsgen
cli/codegen/static/static.go:5: running "go": exit status 1
Error: running "go generate -tags=dev ./cli/codegen/static" failed with exit code 1
@DifferentialOrange DifferentialOrange added the documentation Improvements or additions to documentation label Nov 9, 2021
@mRrvz
Copy link
Contributor

mRrvz commented Nov 16, 2021

About this error (which you described above): it should disappear after #637.

@Totktonada Totktonada added code health Improve code readability, simplify maintenance and so on teamE labels Nov 30, 2021
DifferentialOrange added a commit that referenced this issue Dec 21, 2021
After PR #464 calling `mage clean` was broken. After execution of
`mage generateGoCode` FSFile was created in path
`cli/create/create_vfsdata_gen.go`, while `mage clean` tried to remove
it from `cli/codegen/static/create_vfsdata_gen.go` path.

Part of #658
DifferentialOrange added a commit that referenced this issue Dec 21, 2021
Before this patch, calling `mage integration`, `mage testExamples` or
`mage e2e` failed if `mage GenerateGoCode` hasn't been called yet
(explicitly or as `mage lint`, `mage unit` or `mage build` dependency).
Now all targets that require generated code explicitly depends on it.

Documentation says "Dependencies are guaranteed to run exactly once in
a single execution of mage" [1], but if there are several mage
executions (like in this repo CI), dependencies are run multiple times.
After this patch, Go code will not be rebuilt with `GenerateGoCode()`
if build artifacts presents, so CI will not do multiple deps calls. If
you want to rebuild the code, call `mage clean` first.

Part of #658
DifferentialOrange added a commit that referenced this issue Dec 21, 2021
Before this patch, calling `mage integration`, `mage testExamples` or
`mage e2e` failed if `mage GenerateGoCode` hasn't been called yet
(explicitly or as `mage lint`, `mage unit` or `mage build` dependency).
Now all targets that require generated code explicitly depends on it.

Documentation says "Dependencies are guaranteed to run exactly once in
a single execution of mage" [1], but if there are several mage
executions (like in this repo CI), dependencies are run multiple times.
After this patch, Go code will not be rebuilt with `GenerateGoCode()`
if build artifacts presents, so CI will not do multiple deps calls. If
you want to rebuild the code, call `mage clean` first.

1. https://magefile.org/dependencies/

Part of #658
DifferentialOrange added a commit that referenced this issue Dec 21, 2021
Before this patch, calling `mage integration`, `mage testExamples` or
`mage e2e` failed if `mage GenerateGoCode` hasn't been called yet
(explicitly or as `mage lint`, `mage unit` or `mage build` dependency).
Now all targets that require generated code explicitly depends on it.

Documentation says "Dependencies are guaranteed to run exactly once in
a single execution of mage" [1], but if there are several mage
executions (like in this repo CI), dependencies are run multiple times.
After this patch, Go code will not be rebuilt with `GenerateGoCode()`
if build artifacts present, so CI will not do multiple deps calls. If
you want to rebuild the code, call `mage clean` first.

1. https://magefile.org/dependencies/

Part of #658
DifferentialOrange added a commit that referenced this issue Dec 22, 2021
Add README.dev.md file with list of test requirements. Describe
mage test commands in dev.md file.

Closes #658
DifferentialOrange added a commit that referenced this issue Dec 22, 2021
After PR #464 calling `mage clean` was broken. After execution of
`mage generateGoCode` FSFile was created in path
`cli/create/create_vfsdata_gen.go`, while `mage clean` tried to remove
it from `cli/codegen/static/cartridge_vfsdata_gen.go` path.

Part of #658
DifferentialOrange added a commit that referenced this issue Dec 22, 2021
Before this patch, calling `mage integration`, `mage testExamples` or
`mage e2e` failed if `mage GenerateGoCode` hasn't been called yet
(explicitly or as `mage lint`, `mage unit` or `mage build` dependency).
Now all targets that require generated code explicitly depends on it.

Part of #658
DifferentialOrange added a commit that referenced this issue Dec 22, 2021
Documentation says "Dependencies are guaranteed to run exactly once in
a single execution of mage" [1], but if there are several mage
executions (like in this repo CI), dependencies will run multiple times.
After this patch, Go code will not be rebuilt with `GenerateGoCode()`
if build artifacts present, so CI will not do multiple deps calls. If
you want to rebuild the code, call `mage clean` first.

1. https://magefile.org/dependencies/

Part of #658
DifferentialOrange added a commit that referenced this issue Dec 22, 2021
Add README.dev.md file with list of test requirements. Describe
mage test commands in dev.md file.

Closes #658
DifferentialOrange added a commit that referenced this issue Dec 27, 2021
Add README.dev.md file with list of test requirements. Describe
mage test commands in dev.md file.

Closes #658
LeonidVas pushed a commit that referenced this issue Dec 30, 2021
After PR #464 calling `mage clean` was broken. After execution of
`mage generateGoCode` FSFile was created in path
`cli/create/create_vfsdata_gen.go`, while `mage clean` tried to remove
it from `cli/codegen/static/cartridge_vfsdata_gen.go` path.

Part of #658
LeonidVas pushed a commit that referenced this issue Dec 30, 2021
Before this patch, calling `mage integration`, `mage testExamples` or
`mage e2e` failed if `mage GenerateGoCode` hasn't been called yet
(explicitly or as `mage lint`, `mage unit` or `mage build` dependency).
Now all targets that require generated code explicitly depends on it.

Part of #658
LeonidVas pushed a commit that referenced this issue Dec 30, 2021
Add README.dev.md file with list of test requirements. Describe
mage test commands in dev.md file.

Closes #658
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code health Improve code readability, simplify maintenance and so on documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants