Skip to content

Conversation

@ikbear
Copy link
Contributor

@ikbear ikbear commented Jan 18, 2013

No description provided.

README.md Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

[![Build Status](https://travis-ci.org/qiniu/nodejs-sdk.png?branch=master)](https://travis-ci.org/qiniu/nodejs-sdk)

test/config.js Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

上次不是讨论了,ACCESS_KEY, SECRET_KEY 这种变量,不应该出现在代码里面,应该放到 travis 的环境变量里面么?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已更新。

Copy link
Contributor

Choose a reason for hiding this comment

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

老许是说放到 .travis.yml 的 env 中,感觉没有必要了,这个 .travis.yml 也是可见的。必须要暴露一对测试用的密钥。

test/rs.test.js Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

test/rs.test.js Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

bucket 名也放到 env 中:QINIU_TEST_BUCKET

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这个 bucket 名是根据时间来生成的,每次测试通过后会删除。在 travis-ci.org 里并行跑 0.6 以及 0.8 版本的 Node.js,可能一个环境创建好 bucket 后在使用完成前,这个 bucket 就被另一个环境删除了。所以我让每个环境生成的 bucket 都不一样。

Copy link
Contributor

Choose a reason for hiding this comment

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

no, 用同一个 bucket 有问题的。

问题1: 多个 jobs 并发跑测试,job1若drop bucket, 会导致job2,job3的单元测试跑失败
问题2: before_all:mkbucket, after_all:drop 也是测试的 case, 不管其他 case 有无执行失败, after_all 都会清理 drop test bucket

Copy link
Contributor

Choose a reason for hiding this comment

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

固定 bucket 会漏测 /mkbucket 和 /drop 接口, 对一般集成测试来讲,还是测的比较全面比较好,用单元测试构建整个上下文是最好的。况且 drop 现在也没有副作用

Copy link
Contributor

Choose a reason for hiding this comment

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

还有一个问题。如果固定 bucket, 那么多个 VMs 在跑的时候都是跑的同1套CASEs, 并发的测试程序操作的 bucket:key 也是同1个,不知道会出现什么奇怪问题导致测试失败。严重不建议固化bucket, 整个测试环境上下文本身就应该用单元测试脚本构建和完成,这才是集成测试。

Copy link
Contributor

Choose a reason for hiding this comment

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

那你这里也没有做到不一样,在同一秒运行多个案例,就冲突了。

Copy link
Contributor

Choose a reason for hiding this comment

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

可以取到nodejs版本么?要不用 "qiniutest" + env.VMSTRING

Copy link
Contributor Author

Choose a reason for hiding this comment

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

在同一秒运行多个案例的情况很少发生。固化 bucket 导致的 travis-ci.org 测试错误是经常发生的。

Copy link
Contributor

Choose a reason for hiding this comment

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

精度需要高点,jobs 一般同时跑5个,也就是说1秒内都在并发的跑。可以精确到毫秒

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Timer.ontimeout,需 Restart Build.

qiniu pushed a commit that referenced this pull request Jan 23, 2013
@qiniu qiniu merged commit 87efa36 into qiniu:develop Jan 23, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants