From 3573e1a0b2d3129b191e21047b7bbf0b754bc6e5 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Wed, 11 Dec 2024 18:14:55 +0100 Subject: [PATCH 1/2] [TT-1894] add logstream flushing to default ccip cleanup (#1570) ## Motivation No Docker container logs are ever dumped. ## Solution CCIP local cluster setup was missing crucial part of flushing the logs. --- .../ccip-tests/testsetups/ccip.go | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/integration-tests/ccip-tests/testsetups/ccip.go b/integration-tests/ccip-tests/testsetups/ccip.go index eee424d50d..74fdd3c35b 100644 --- a/integration-tests/ccip-tests/testsetups/ccip.go +++ b/integration-tests/ccip-tests/testsetups/ccip.go @@ -35,6 +35,7 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/config" "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/environment" "github.com/smartcontractkit/chainlink-testing-framework/lib/networks" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/osutil" "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" integrationactions "github.com/smartcontractkit/chainlink/integration-tests/actions" @@ -1386,6 +1387,10 @@ func (o *CCIPTestSetUpOutputs) CreateEnvironment( t.Cleanup(func() { if configureCLNode { if ccipEnv.LocalCluster != nil { + if t.Failed() || (ccipEnv.LocalCluster.TestConfig.GetLoggingConfig() != nil && ccipEnv.LocalCluster.TestConfig.GetLoggingConfig().TestLogCollect != nil && *ccipEnv.LocalCluster.TestConfig.GetLoggingConfig().TestLogCollect) { + flushClLogs(*lggr, ccipEnv.LocalCluster) + } + err := ccipEnv.LocalCluster.Terminate() require.NoError(t, err, "Local cluster termination shouldn't fail") require.NoError(t, o.Reporter.SendReport(t, namespace, false), "Aggregating and sending report shouldn't fail") @@ -1406,6 +1411,24 @@ func (o *CCIPTestSetUpOutputs) CreateEnvironment( return chainByChainID } +func flushClLogs(l zerolog.Logger, testEnv *test_env.CLClusterTestEnv) { + l.Info().Msg("Shutting down LogStream") + logPath, err := osutil.GetAbsoluteFolderPath("logs") + if err == nil { + l.Info().Str("Absolute path", logPath).Msg("LogStream logs folder location") + } + + l.Info().Msg("Flushing LogStream logs") + // we can't do much if this fails, so we just log the error in LogStream + if err := testEnv.LogStream.FlushAndShutdown(); err != nil { + l.Error().Err(err).Msg("Error flushing and shutting down LogStream") + } + testEnv.LogStream.PrintLogTargetsLocations() + testEnv.LogStream.SaveLogLocationInTestSummary() + + l.Info().Msg("Finished shutting down LogStream") +} + func createEnvironmentConfig(t *testing.T, envName string, testConfig *CCIPTestConfig, reportPath string) *environment.Config { envConfig := &environment.Config{ NamespacePrefix: envName, From 61344f39aced35ef35652ff4b6f639e792a9bc40 Mon Sep 17 00:00:00 2001 From: Rens Rooimans Date: Thu, 12 Dec 2024 21:53:51 +0100 Subject: [PATCH 2/2] refer to online license instead of file (#15631) (#1571) Cherry pick from `chainlink` Co-authored-by: app-token-issuer-infra-releng[bot] <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com> --- contracts/README.md | 8 +++----- contracts/package.json | 1 - contracts/src/v0.8/ccip/LICENSE-MIT.md | 21 --------------------- 3 files changed, 3 insertions(+), 27 deletions(-) delete mode 100644 contracts/src/v0.8/ccip/LICENSE-MIT.md diff --git a/contracts/README.md b/contracts/README.md index 16ba2e8254..6234dfaf9b 100644 --- a/contracts/README.md +++ b/contracts/README.md @@ -47,8 +47,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Most of the contracts are licensed under the [MIT](https://choosealicense.com/licenses/mit/) license. An exception to this is the ccip folder, which defaults to be licensed under the [BUSL-1.1](./src/v0.8/ccip/LICENSE.md) license, however, there are a few exceptions -The CCIP repo is licensed under the [BUSL-1.1](./src/v0.8/ccip/LICENSE.md) license, however, there are a few exceptions - -- `src/v0.8/ccip/applications/*` is licensed under the [MIT](./src/v0.8/ccip/LICENSE-MIT.md) license -- `src/v0.8/ccip/interfaces/*` is licensed under the [MIT](./src/v0.8/ccip/LICENSE-MIT.md) license -- `src/v0.8/ccip/libraries/{Client.sol, Internal.sol}` is licensed under the [MIT](./src/v0.8/ccip/LICENSE-MIT.md) license +- `src/v0.8/ccip/applications/*` is licensed under the [MIT](https://choosealicense.com/licenses/mit/) license +- `src/v0.8/ccip/interfaces/*` is licensed under the [MIT](https://choosealicense.com/licenses/mit/) license +- `src/v0.8/ccip/libraries/{Client.sol, Internal.sol}` is licensed under the [MIT](https://choosealicense.com/licenses/mit/) license \ No newline at end of file diff --git a/contracts/package.json b/contracts/package.json index 4845ddef57..a723082974 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -47,7 +47,6 @@ "src/v0.8/vendor/Pausable.sol", "abi/v0.8/", "src/v0.8/ccip/LICENSE.md", - "src/v0.8/ccip/LICENSE-MIT.md", "src/v0.8/ccip/v1.5-CCIP-License-grants.md", "!src/v0.8/ccip/test/**/*", "src/v0.8/ccip/test/mocks/**/*", diff --git a/contracts/src/v0.8/ccip/LICENSE-MIT.md b/contracts/src/v0.8/ccip/LICENSE-MIT.md deleted file mode 100644 index 812debd8e9..0000000000 --- a/contracts/src/v0.8/ccip/LICENSE-MIT.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2018 SmartContract ChainLink, Ltd. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file