keep-network / local-setup

Allow to easily set up tBTC and Keep locally for development and test purposes.
MIT License
8 stars 16 forks source link

Fix issues with `sed` command and Go version in the E2E tests script #102

Closed michalinacienciala closed 3 years ago

michalinacienciala commented 3 years ago

E2E tests / Locally workflow was failing due to incorrect syntax of sed command in the install script for keep-ecdsa and due to too old version of Go installed on the virtual machine.

More context:

Syntax of the sed -i command is different for MacOS and for GNU systems. The command in its old shape was failing when run on Ubuntu (during execution of workflow with E2E tests). Fixed by merging the problematic command with another sed command in the same file replacing the text by using temporary file (instead of replacing in the current file).

We're upgrading version of Go used in E2E tests local scripts to 1.16.6. With previously used version building of keep-ecdsa client was failing with note: module requires Go 1.16 error. It turned out that just changing the version of Go in the install-go.sh script was not sufficient, we had to rework the way we're installing Go. With previous way of installing Go, the 1.15.13 version was always used, no matter what version was specified in the install-go.sh script. This likely was caused by the fact that Go 1.14.15, 1.15.13 and 1.16.5 are the cached tools of the ubuntu-latest virtual environment. We are now switching to use of the setup-go action to force using of 1.16 version of Go.

michalinacienciala commented 3 years ago

With the new way of installing Go we're no longer using deployments/local-setup-environment/provisioning/install-go.sh script during running workflow for local E2E tests. I'd like to delete it if it's no longer needed, but I can see the file being referenced in packerfile.json. I'm not sure what is the role of this file and whether the go-install.sh file and reference to it in packerfile.json can be safely removed without braking some other functionality.

michalinacienciala commented 3 years ago

Regarding testing of the changes proposed in this PR: the workflow run on the feature branch is failing due to #100 and #101 changes not present on the feature branch. But I created a temporary branch with changes from the from #100, #101 and #102 PRs and I run the workflow on that branch. Here are the results: https://github.com/keep-network/local-setup/runs/3113694383?check_suite_focus=true.

beaurancourt commented 3 years ago

Just tested this out locally. Looks good to me!

beaurancourt commented 3 years ago

I'll let kuba take a look and sign off as well!

lukasz-zimnoch commented 3 years ago

With the new way of installing Go we're no longer using deployments/local-setup-environment/provisioning/install-go.sh script during running workflow for local E2E tests. I'd like to delete it if it's no longer needed, but I can see the file being referenced in packerfile.json. I'm not sure what is the role of this file and whether the go-install.sh file and reference to it in packerfile.json can be safely removed without braking some other functionality.

The deployments/local-setup-environment/provisioning/install-go.sh was initially created as a provisioning script for Packer (pakerfile.json). In our use case, Packer builds a virtual machine image that can be used to orchestrate a Vagrant virtual machine ready to work with Keep Network projects. After some time, we developed e2e test jobs and we just reused the install-go.sh. Removing it will break Packer.