Excellent if long hike great views of Yari and Hotakas.

Difficulty: Easy/Moderate(long day out, no real technical challenges or exposure, take care when crossing snow patches on descent)

Following the trail leading from the parking lot to Mae Jonen, you climb through forest that changes in character as you gain elevation. As you see more and more evergreens you know you are getting close and passing the 2000m mark, once the view opens up it is breathtaking. In the south west you can sometimes see Mt Fuji peaking above clouds!

Once you gain the ridge and only thng growing around is the Japanese pine and flowers it is a short traverse over and up to the Mt Jonen itself. With spectacular view of Yari gatake and Hotakas. Rest take in the scenery then head it is a descending traversre to Chogatake with appropriate beatiful views of surrounding mountains. Trail is well worn and easy to follow. As you approach Chogatake you will find a small area with a big stone marker marking a place where climbers died in winter getting caught in a storm pay respects. From there it is a short walk over to the Sanso and the welcome beer. Take a break enjoy the gorgeous view of Hotaka and the famous Godzilla scale Mae Hotaka climbing route(one day!).

Bag the Chogatake “peak” then head down the trail back through the forest. Take care early in the season you will be crossing a lot of snow. Kick the steps or use spikes, or even crampons(not necessary). If you are wearing soft hiking shoe try and stick to the steps created by people before you. Ususally there is a well worn path. Chogatake translates as Butterfly mountain, you will see many of them everywhere as you spend next few hours descending. Take picture, look at flowers rest as needed. Eventually you get to a lookout with a nice view of Azumino through the valley.

Another hour or so and we are back to the river and short walk over back to the parking lot. You are done. Whole trip took us about 9 hours. There is a lot of going up and down, but advantage is carrying lighter pack and moving faster.

Comment and share

Postgres is an excellent open source RDBMS. Here is a simple approach to have a setup for your API or integration level tests with Mocha.

Setup

Once you have Node and Postgres running install an excellent Postgres driver Node-postgres

npm install pg

then Mocha

npm install mocha

First we need a snapshot of the database you want to test against.

mkdir test //for your mocha tests
sqldump <your-db-name> -f test/testdb.sql

Inside your Mocha test file we can setup what do before tests run. It will look something a long the lines of

var assert = require("assert")
 , http = require('http')
 , should = require('should')
 , request = require('request')
 , exec = require('child_process').exec


describe("app", function(){
  before(function(done){
    ...
  });
  after(function(done){
    ...
  });

  it('should your tests', function(done){
    ..
    done();
  });
});

Objective is to setup a clean database run tests then drop the database and end inthe beginning state, ready to run tests again

Here is a simple database create and then run our testdb.sql dump

function prepare_db(next){
  exec('createdb testdb', function(err){
      if (err !== null) {
      console.log('exec error: ' + err);
      }
      exec('psql -d testdb -f test/testdb.sql', function(err){
        if (err !== null) {
          console.log('exec error: ' + err);
        }
        next(err);
        });
      });
}

So we first create the database with createdb utility, then run our sql dump with exec

Inside the before function all we need to do is

before(function(done){
  prepare_db(function(err){
    if(err){
      ..
    }
    //do other setup stuff like launching you server etc
  })
});

Next we make a simple sql script to drop our test database

drop database testdb;

Then we can run it with exec same as our sql dump

function clean_db(next){
  exec('psql -d somedb -f test/dropdb.sql', function(err){
    if (err !== null) {
      console.log('exec error: ' + err);
    }
    next();
  });
}

And then add it to after function

after(function(done){
  clean_db(function...

Depending on database size the setup step can be not as fast as we wish if we try to use production size database there. For normal constant testing I found using a simpler dev database simple and faster. It is however possible to setup different snapshots to run the tests as background automated process that will not drive you nuts when you make modification and want to run a quick test.

Comment and share

Setup

If you have tried using Siege to test your app on heroku you probably realized that something is not right. Blitz plugin makes this pretty easy, even a developer can do it.

Most of these steps can be found in the great documentation Heroku has on their site, but few important ones are missing (link)[http://devcenter.heroku.com/articles/blitz]

Add Blitz.io plugin to your Heroku app by going to your app folder and

heroku addons:add blitz:250

250 is the free tier, you can test to your heart’s content. Higher tiers are billed by second so you can run large test if you need and only get charged few bucks for them. Next install the gem

gem install blitz

Next figure out your credentials, go to your app page on heroku then to the plugin page from there. If you are a contributor the user name will be the one of the app owner not your own

--api-key

you will get back the user name and a key

Next setup these credentials

blitz api:init

Let us try rushing

blitz curl -r california -p 1-250:60 http://<your app>.herokuapp.com/

If you are using http this will work, for https you need to add a route into your app that tells Blitz.io that it is your app! For Express just throw this in

app.get('/<the code that you get from console when you try to run your https app>', function (req, res) {
  res.send('42');
});

Done. Next we can integrate this into our process on continuous deployment (once I have this polished for my own app I will post about it). There are many things you can test as well, different regions (very interesting to see how this works from Singapore and Japan). You can see what happens when you scale your app to multiple Heroku workers as well.

Comment and share

  • page 1 of 1

Dmytro Yashkir

Canadian programmer living in Japan, climber of mountains, coder of things, student of languages, conoseur of Beer and Nihonshu


Nodejs, Postgres, Ruby, Redis, Swift


Shiojiri, Nagano, Japan