Skip to content
This repository has been archived by the owner on Jul 23, 2019. It is now read-only.

Initial Travis Config #48

Merged
merged 13 commits into from Mar 26, 2018
Merged

Initial Travis Config #48

merged 13 commits into from Mar 26, 2018

Conversation

chgibb
Copy link
Contributor

@chgibb chgibb commented Mar 17, 2018

Initial config for Ubuntu on Travis. At the moment this is fairly bare bones as it only builds xray and does not run tests. See log. There were some issues with clang and rustup that required some fiddling and the commit history reflects that.

#22

@as-cii
Copy link
Contributor

as-cii commented Mar 19, 2018

Thanks for this pull request, @chgibb!

As @nathansobo mentioned on #22, we are in the process of revising the architecture of xray and this may affect the way things get tested. We'll make sure to take a look at this once #46 lands on master. Thanks!

@nathansobo
Copy link

Now that we have merged #46, are you interested in adjusting this PR to the new reality?

Now we should be able to run all of our tests without Electron. This makes @maxbrunsfeld and I think that it would be better to target Travis's Rust environment. Then we should be able to run cargo test in the root of the workspace. We also have a few tests in xray_electron that can be run with a vanilla Node installation, which can be installed as a package.

Thanks!

@chgibb
Copy link
Contributor Author

chgibb commented Mar 22, 2018

Definitely @nathansobo !
You simply want me to change the environment preset to Rust and invoke cargo test in the root? I would caution against running tests without testing Electron components. From experience, smoke testing with Electron is fairly straight forward and can catch breakages that other methods cannot.

@nathansobo
Copy link

@chgibb I think we'll eventually want to add integration tests that touch Electron, but for now we don't have any and are getting by reasonably well with Enzyme. Since all of the real logic is in the server, I think the risk is lower than it might be for a more complex Electron app. But eventually we'll probably need some Electron-specific tests.

@chgibb
Copy link
Contributor Author

chgibb commented Mar 22, 2018

I changed the script to use Travis' default rust config which calls cargo build and cargo test with --verbose on both so the log is a little noisy. Let me know if this looks good.

@maxbrunsfeld
Copy link
Contributor

maxbrunsfeld commented Mar 23, 2018

This looks good. Are you up for adding a script that also runs npm install and npm test in the xray_electron directory? I'm guessing node isn't installed by default when language is set to rust, so we'll need to install it, using the addons system if possible.

@chgibb
Copy link
Contributor Author

chgibb commented Mar 23, 2018

Threw node and xray_electron install and test into the Travis script. Also removed --verbose from cargo build and cargo test. Should this whole functionality be split off into a bash script so it can be run by users? See log.

@maxbrunsfeld
Copy link
Contributor

Can this be done without sudo? I think Travis’s container infrastructure has lower wait times.

The bash script is a good idea. I’d call it ‘script/test’.

@Arcanemagus
Copy link
Contributor

Can this be done without sudo?

Note that you can run most sudo commands in sudo: false images, basically if you just need root to install software you should be good, it's when you need "real" hardware access that you need the sudo: required builds.

@chgibb
Copy link
Contributor Author

chgibb commented Mar 23, 2018

Split off into script and removed sudo: required. See log.

npm test
if [ $? != 0 ]; then
exit 1
fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you could avoid a lot of these if statements by adding set -e to the top of the script.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set -e introduces a fair few hidden footguns by aborting after any non-zero exit code. If I remember correctly, there's also some differing behaviour between set -e in GNU Bash, MSys2 and Cygwin. I would argue against it, and personally prefer the more manual error handling. However, I can change it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 No nevermind, this seems fine.

@maxbrunsfeld maxbrunsfeld merged commit c0b929b into atom-archive:master Mar 26, 2018
@maxbrunsfeld
Copy link
Contributor

Thanks @chgibb!

@lucat1 lucat1 mentioned this pull request Apr 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants