Closed camillof closed 2 years ago
@camillof so I'm testing this out on my end but getting the following error:
➜ Downloads ./test-reporter-0.10.4-linux-arm64
zsh: exec format error: ./test-reporter-0.10.4-linux-arm64
Gonna try pulling your version and rebuilding locally and see what happens when i try to run that, but if youve run into this before would love to hear what you did to fix it.
Quick update here. The versions released are for linux
based computers, not darwin
. That's why we couldn't get them to work on @RubyBrewsday computer. The bad news is that for compiling for darwin arm64, we need go 1.16 (and the project is on 1.15 and I’m afraid many changes are needed before upgrading)
I'll try to get access to a linux arm64 based EC2 instance (Graviton EC2 instance) and try those there.
To add some extra context that @camillof and I already chatted about offline, it does seem like for what it's worth that the version we currently have up for codeclimate.com/downloads/test-reporter/test-reporter-latest-darwin-amd64 actually works when I run it locally on my M1 mac :/
➜ Downloads ./test-reporter-latest-darwin-amd64
Report information about tests to Code Climate
Usage:
cc-test-reporter [flags]
cc-test-reporter [command]
Available Commands:
after-build Locate, parse, and re-format supported coverage sources. Upload pre-formatted coverage payloads to Code Climate servers.
before-build To be run before a build
env Infer and output information about the environment the reporter is running in.
format-coverage Locate, parse, and re-format supported coverage sources.
help Help about any command
show-coverage Show coverage results in standard output
sum-coverage Combine (sum) multiple pre-formatted coverage payloads into one.
upload-coverage Upload pre-formatted coverage payloads to Code Climate servers.
Flags:
-d, --debug run in debug mode
-v, --version Show version information
Use "cc-test-reporter [command] --help" for more information about a command.
➜ Downloads ./test-reporter-latest-darwin-amd64 before-build
➜ Downloads
Haven't actually tried testing it out in terms of running any kind of test coverage locally and using the library but part of me does kinda sorta wonder if we just change the name of the executable if it would magically just "work".
I created a EC2 graviton arm64 instance for testing:
[ec2-user@ip-10-0-0-22 ~]$ uname -m
aarch64
After copying the binary into the instance, I was able to successfully upload a test report to CC.
[ec2-user@ip-10-0-0-22 mfcs-ruby-test-simplecov]$ CC_TEST_REPORTER_ID=XXXXXX ../test-reporter-0.10.4-linux-arm64 after-build
Test report uploaded successfully to Code Climate
From my point of view, this validates that the binary is working correctly on arm64 machines
@camillof I'm ok with that as well. I'd be curious to publish this package and then once it's up pulling that down and seeing if I can run that locally. But yeah good stuff!
If everything works well, I'll push another PR to update the README, to publish the arm64 linux versions.
...it does seem like for what it's worth that the version we currently have up for codeclimate.com/downloads/test-reporter/test-reporter-latest-darwin-amd64 actually works when I run it locally on my M1 mac :/
My guess is that it works because of the "Rosetta" layer on your Mac.
I tried using this in the latest CircleCI (which can run on M1 machines) and those machines don't have have Rosetta installed, apparently, because I get this message:
/bin/bash: ./cc-test-reporter: Bad CPU type in executable
Updated Makefile so the ARM64 version of the test-reporter is available to be built.
So far, it has been tested by successfully uploading a test coverage from an Ubuntu arm64 image using this new test-coverage binary.
I also updated the Makefile so the release of this binary is included on new releases. For this, I run the new
build-linux-arm64
command inside acircleci/golang:1.15
container to be sure everything is ok -> The binary was built successfully.⚠️ Is it worth creating a CI step for running the tests on a linux arm64 image?
Generated ARM64 binary ⬇️ test-reporter-0.10.4-linux-arm64.zip